What I'm thinking of is that a floating point value not always kan be represented exactly and that your first and second case might be represented as 4.499999999999999..... in your box, which would explain the rounddown.
You could look into the Posix routines for a possibly alternate route to achieve your aim.
---
I would like to change the world but God won't let me have the source code.
In reply to Re: Rounding With sprintf anomaly?
by guha
in thread Rounding With sprintf anomaly?
by oakbox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |