P is for Practical | |
PerlMonks |
Re^7: Variables are automatically rounded off in perl (slippery)by syphilis (Archbishop) |
on Jul 26, 2016 at 00:36 UTC ( [id://1168518]=note: print w/replies, xml ) | Need Help?? |
The output was the intuitive ("nice") version Did you look at the intermediate values ? (That's what your original complainants were doing.) Those are actually correct values (rounded to 15 decimal digits of precision) for a perl whose nvtype is an 8-byte double. And it's also to be expected (given perl's current practice) that the next (and last) value to be calculated is printed as "1" - because 1.0000000000000007 rounded to 15 decimal digits of precision is exactly that. Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|