WC -Sx- Jones wrote:
However - it is still strange that odd rounding and even rounding are different. I *strongly* suggest that you upgrade to a more recent Perl release soonest - if at all possible.
Doesn't printf/sprintf in your version od Perl (or C for that matter) use banker rounding by default? Could you please tell me what platform and version of Perl as well as libc are you using? How does sprintf round on your system?
I wasn't the orginal poster :)
My system is Solaris 5.8.0 Ultrasparc and it rounds correctly with all tests I can think up
Including printing the expected results from your other post. Which I did like the C POSIX tests as well.
The problem from the other poster is:
1) I have 1.5 which is 1 on my system AFTER I run the following code. Q) What is it on yours after you run it?
$val = 1.5; $result = sprintf("%.0f", $val);
# The error is that it is 1 on his =/
It is 2 on my system.
HTH -Sx- :)
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>