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


Groups > comp.lang.python > #91518 > unrolled thread

Re: Minus operator versus unary minus

Started bySerhiy Storchaka <storchaka@gmail.com>
First post2015-05-30 11:45 +0300
Last post2015-05-30 11:45 +0300
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#91518 — Re: Minus operator versus unary minus

FromSerhiy Storchaka <storchaka@gmail.com>
Date2015-05-30 11:45 +0300
SubjectRe: Minus operator versus unary minus
Message-ID<mailman.217.1432975544.5151.python-list@python.org>
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 
 


[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web