fudge() is good. I will add it as an alias. I couldn't think of anything better at the time. might_be() looks_like() probably() possibly() neaten() all seemed...well a little wishy washy.
You are of course right about the psychological tendency. That's why the marketers love $9.99 etc because it just seems less than a 10 spot. Still don't get much useful change though.
Do you know if there is anything in Perl that implements the standards. A Math::AcurateFloatingPoint class would be quite possible using Math::BigInt without too much work. You just need to delta to integers for the operations and then return the result as a float object (stringified of course to preserve accuracy). I don't know if there would be much demand though.
The stats about > 50% of database table numerical columns using floats (including financials) was interesting.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Re^3: Fix floats like you do in your head
by tachyon
in thread Fix floats like you do in your head
by tachyon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |