develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [DOC PATCH bleadperl] detypo Math::BigInt docs

Thread Previous | Thread Next
Philip Newton
July 10, 2001 13:08
Re: [DOC PATCH bleadperl] detypo Math::BigInt docs
Message ID:
On 10 Jul 01, at 15:52, John Peacock wrote:

> 0 cannot ever be positive or negative by itself (that is truly the definition 
> of positive {>0} and negative {<0} ).

True; however, as I understand it, IEEE floating-point arithmetic 
allows for there to be positive and negative zero since it uses a sign-
magnitude representation. And Math::Big* objects also store the sign 
separately, so they can (potentially) have positive and negative 

> Therefore 0/0==0 is a sensible default (since 0/num == 0 for all
> other num). 

On the other hand, if a/b==c, then b*c == a. This holds for 10/5==2 --> 
5*2==10, but not if you posit 0/0==0, since 0*0==0, but 5*0==0 as well, 
so one could argue that 0/0 should be 5. This argument holds for any 
possible result. So if 0/0 has any one value, it has to be one that's 
specially defined; NaN makes sense to me for this.

(And what do you think is 0**0? 0**n == 0 for all positive n, but n**0 
== 1 for all positive n.... Presumably, 0**0 is also NaN, then.)

Philip Newton <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About