No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
If you are using '==' or '!=' on computed floating point values, then you've already lost my sympathy
I, of course, am completely shattered at having lost your sympathy ;-) ... we got tons of complaints because the result of code like ... <snip> ... was not a nice "0.5" but "0.5000000000000002". The output of that code is *still* not nice, even today. Try it and you'll see. We need to get the output precision further reduced. Seriously ... you can reduce the decimal precision of print even further, and that sort of procedure can still produce results that are "not nice": We need to reduce displayed output to no more than 10 decimal digits ?? (Even less) The "unniceness" of those results come from cumulatively adding a value that is not precisely 1/100. I don't see that it has much to do with the decimal precision of print()'s output. People who can't stand miscounting one grain of sand on their huge beach are a much better choice for who needs to do a tiny bit of extra work Yes, that's the current state of play. I hope you pointed that out to the people who complained about the output of the snippet you provided. And I'm sure they were quite happy to do that extra work. Cheers, Rob In reply to Re^5: Variables are automatically rounded off in perl (audiences)
by syphilis
|
|