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

[PATCH bleadperl] Math::Big* doc patches (and some code)

From:
Philip Newton
Date:
July 10, 2001 00:51
Subject:
[PATCH bleadperl] Math::Big* doc patches (and some code)
Message ID:
20010710.095300@ID-11583.news.dfncis.de
A few typo and style corrections for the Math::Big* docs, and a couple 
of code patches (see the attachment; I didn't want to copy-and-paste 
because of tab-vs-space issues).

Some comments on a couple of the changes:

lib/Math/BigInt/t/bigintpm.t:
- I assume that Tels's comment was made this year, not last

lib/Math/BigInt/Calc.pm:
- no special comments

lib/Math/BigFloat.pm:
- is_odd and is_even claim to return "true if ... is odd or -1 if 
even"; I presume this is "...or false even", since -1 is also true? I 
changed the docs to reflect that assumption, but didn't check the code.
- The sentence "The second parameter to the round functions" I made 
part of the preceding paragraph. It looked as if it was a paragraph on 
its own, because the line started with 80-odd spaces, which gave the 
impression of a blank line before that line. Maybe someone wants it in 
its own paragraph, but that line appeared to be part of the previous 
paragraph before the last change, so I changed back to that.

lib/Math/BigInt.pm:
- removed implementation-specific detail ("array '+', '1')" from 
comment in is_one
- is_odd and is_even: added comment about NaN and inf from 
Math::BigFloat.pm
- changed /^[\+]/ to /^\+/, /^[\-]/ to /^-/, s/^[+-]?// to s/^[+-]//, 
and /^[\-\+]?/ to /^[+-]?/ in a couple of places
- comment says 5/0 = +inf, -6/0 = -inf and asks whether 0/0 should be 1 
or +inf. Shouldn't it be NaN instead? Added that possibility to the 
list, but I think it should be the only possibility. Any mathematicians 
or IEEE854(?) specialists?
- what about the portability of changing '::' to '/' in order to load a 
module with require? Should work on Win32, Unix, and VMS, I think, but 
what about Macs? Possibly use File::Spec here?
- changed 'dot' to 'decimal point' in a couple of places.
- I think "Math::Current" should be "Math::Currency"
- Docs claimed that dividing by zero could lead to NaN. I think it 
leads to +-inf instead, so I snipped that part. Possibly mention that 
0/0 can be NaN, but I'm not sure that belongs in the discussion of the 
sign (ie "how can a NaN be generated").

Cheers,
Philip
-- 
Philip Newton <Philip.Newton@gmx.net>



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