Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #91518

Re: Minus operator versus unary minus

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!feed.xsnews.nl!fbe001.ams.xsnews.nl!news.roellig-ltd.de!open-news-network.org!border2.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.027
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'modification': 0.15; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'result[elem]': 0.16; 'subject:versus': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'checked': 0.31; 'url:python': 0.33; 'to:addr:python-list': 0.35; 'url:org': 0.36; 'subject:: ': 0.37; 'received:org': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'charset:windows-1252': 0.65; 'obvious': 0.72; 'otten': 0.84; 'url:cpython': 0.84; 'url:rev': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Serhiy Storchaka <storchaka@gmail.com>
Subject Re: Minus operator versus unary minus
Date Sat, 30 May 2015 11:45:32 +0300
References <mkbqfn$9p0$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 193.202.118.164
User-Agent Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
In-Reply-To <mkbqfn$9p0$1@ger.gmane.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.217.1432975544.5151.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1432975544 news.xs4all.nl 2906 [2001:888:2000:d::a6]:43711
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:91518

Show key headers only | View raw


On 30.05.15 10:56, Peter Otten wrote:
> The following modification of the collections.Counter implementation
>
> https://hg.python.org/cpython/rev/fe4efc0032b5
>
> was just checked in with the line
>
> result[elem] = 0 - count
>
> Does this have an advantage over the obvious
>
> result[elem] = -count
>
> ?

>>> x = 0.0
>>> -x
-0.0 
 

>>> 0 - x
0.0 
 


Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Minus operator versus unary minus Serhiy Storchaka <storchaka@gmail.com> - 2015-05-30 11:45 +0300

csiph-web