Re: need clarification on -0

2009-11-30 Thread moijes12
On Nov 28, 12:55 pm, Erik Max Francis wrote: > moijes12 wrote: > > I know the value -0 is quite meaningless and makes little sense.But I > > was just fiddling.I am unable to figure out the below result > > -0 and True > > 0 --> (Why is this 0 and not say True or False) > -0 and f

Re: need clarification on -0

2009-11-30 Thread Erik Max Francis
moijes12 wrote: I know the value -0 is quite meaningless and makes little sense.But I was just fiddling.I am unable to figure out the below result -0 and True 0 --> (Why is this 0 and not say True or False) -0 and false 0 -0 or True True Could someone please provide me some resour

Re: need clarification on -0

2009-11-28 Thread Ned Deily
In article <009b4bab$0$26925$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: > When it comes to integers, I'm not aware of any mathematical or > programming system which treats -0 and +0 as distinct entities, even if > they have different internal representations. A documented feature of mo

Re: need clarification on -0

2009-11-28 Thread Steven D'Aprano
On Sat, 28 Nov 2009 15:14:31 -0800, Mark Dickinson wrote: >> Actually, there ARE computers where you might not see this result. >> Virtually all of the processors on which Python runs use two's >> complement arithmetic.  In two's complement, there is no separate value >> called -0.  0 and -0 have

Re: need clarification on -0

2009-11-28 Thread Mark Dickinson
On Nov 28, 11:14 pm, Mark Dickinson wrote: > While that's true, I think the implementation of Python is > such that the Python objects -0 and 0 should always be > indistinguishable even on machines where the underlying > architecture represents integers using ones' complement or > sign-magnitude.

Re: need clarification on -0

2009-11-28 Thread Mark Dickinson
On Nov 28, 8:39 pm, Tim Roberts wrote: > moijes12 wrote: > > >I know the value -0 is quite meaningless and makes little sense.But I > >was just fiddling.I am unable to figure out the below result > > -0 and True > >0 --> (Why is this 0 and not say True or False) > -0 and false >

Re: need clarification on -0

2009-11-28 Thread Tim Roberts
moijes12 wrote: > >I know the value -0 is quite meaningless and makes little sense.But I >was just fiddling.I am unable to figure out the below result > -0 and True >0 --> (Why is this 0 and not say True or False) -0 and false >0 -0 or True >True > >Could someone please prov

Re: need clarification on -0

2009-11-28 Thread Steven D'Aprano
On Fri, 27 Nov 2009 23:09:06 -0800, moijes12 wrote: > Hi > > I know the value -0 is quite meaningless and makes little sense. Actually, when it comes to floating point values, it is very useful to be able to distinguish between -0 and +0. > But I > was just fiddling.I am unable to figure out