go ahead... be a heretic | |
PerlMonks |
Re: Re: Re: Fix floats like you do in your headby toma (Vicar) |
on Dec 27, 2002 at 06:48 UTC ( [id://222489]=note: print w/replies, xml ) | Need Help?? |
I agree with the Math::SnapTo decision, it didn't seem consistent with your standard of coding excellence! IIRC some ancient Intel hardware used to keep something like 80 bits of internal precision, and this was typically rounded to 64 bit IEEE by most compilers in some but not all operations. In this case, internal precision was a huge win! When testing multi-platform floating point test code, it is often convenient to account for rounding differences on different platforms. A form of diff called ndiff has been created to "compare putatively similar files, ignoring small numeric differences." I think ndiff would be a useful perl module! It should work perfectly the first time! - toma
In Section
Cool Uses for Perl
|
|