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

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

Thread Previous | Thread Next
From:
Tels
Date:
July 10, 2001 18:56
Subject:
Re: [DOC PATCH bleadperl] detypo Math::BigInt docs
Message ID:
200107102246.f6AMkc914615@xena.tops.net
-----BEGIN PGP SIGNED MESSAGE-----

Moin,

On 10-Jul-01 Philip Newton tried to scribble about:
> 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 
> zeroes.

But (in praxis) there is no -0 in MBI. ;) (And I am glad for that, surely)

>> 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.

Agreed.

> (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.)

0 ** 0 is 1, be definition. Not my fault ;) (I got some sensible arguments
for this..you can't argue with sensible arguments from sensible people ;)

Best wishes,

Tels


- -- 
perl -MMath::String -e 'print \
Math::String->from_number("215960156869840440586892398248"),"\n"'

 http://bloodgate.com/thief/     Thief - The Dark Project
 http://bloodgate.com/perl       My current Perl projects
 http://freedomforlinks.de       Fight for your right to link.
 PGP key available on http://bloodgate.com/tels.asc or via email 

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: latin1

iQEVAwUBO0tkVXcLPEOTuEwVAQGKSwf+I6yOWj0RqYKBR2BBJ0myM/Gd4liFRA8x
7caT8C6BCMg945EzK6vbUpiPgjTOoPLmMDMDv3hlfSuVb81l/Lvy3x6ckQnX/csQ
7yhrfCUBlwuJWOf3EcMfaI6LvYCFBN9DQKbztpdpNCvKbXODRYPUyslAwiNo0ZQm
ggmXs9o3kPmhiIQWgL7Pwpgpw/Pg2kDmoFI81y9uddEq7FFyYIcDbeIsrIi1BniQ
xNyyvFa2xsH6LXVuB1ro1FaIeOu/DlkWBANLoUQbI77baPJ6OCNR9SnDUmoKYjbn
rqS/NCOI6Ljqfjj8hziPyvfQ6O3B0ysSFQ2j1oUleTFl9/TlxMA5iA==
=g2kJ
-----END PGP SIGNATURE-----

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About