Actually, this isn't quite the whole story. Most everyone follows the IEEE convention of "round towards nearest or even."I'm aware of that - but it wasn't applicable in this case. Btw, (s)printf doesn't seem to get it right:
and 0.5 can be represented exactly ...printf "%.15f", 0.5; # prints 0.500000000000000 printf "%.0f", 0.5; # prints 1 and should print 0
-- Hofmator
In reply to Re4: Using (s)printf()
by Hofmator
in thread Using (s)printf()
by reptile
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |