in reply to counter-intuitive sprintf behaviour
This sounds like it's not a problem with sprintf in either the Perl or C incarnations. It's probably more of a problem with how floats are represented in binary. 0.5, for example, may actually be stored as 0.499999999993, or something like that. That rounds to 0. 1.5 may actually be stored as 1.50000004, which rounds to 2.
</off-the-cuff answer>
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: counter-intuitive sprintf behaviour
by Anonymous Monk on Jan 13, 2003 at 21:46 UTC |