Perl Monk, Perl Meditation | |
PerlMonks |
Re^4: what did I just see..?by pryrt (Abbot) |
on Mar 24, 2021 at 17:42 UTC ( [id://11130286]=note: print w/replies, xml ) | Need Help?? |
For the range 0 to 1, then epsilon will always be greater than the error So while we have the example of 0.8 down to 0.1, the difference between the epsilon and the ULP won't be huge. But who knows whether the OP will eventually go beyond that range, and get upset when numbers near 2e-16 start displaying as near 4e-16. That's one of the reasons I was cautioning against applying epsilon in this case, because it might later be generalized to a condition where it's not even close to the real absolute error.
Print rounds down that's not true, as syphilis showed. Here's another example.
Print rounds to nearest to the precision that print "likes" rounding to.
If the float is +/- epsilon from ideal, then adding an epsiol brings it into range of 0 to +2 epsilon from ideal, which will round down to ideal.
In Section
Seekers of Perl Wisdom
|
|