in reply to Re^2: Negative zero? There's gotta be a sprintf that undoes that, right?
in thread Negative zero? There's gotta be a sprintf that undoes that, right?

That's weird. I'm using ActivePerl 5.8.1. But I just tried it on 5.8.6 for Solaris, and got your result there. The fix is to add zero:
my $preround = 0 + sprintf ("%.5f",$example);

Caution: Contents may have been coded under pressure.
  • Comment on Re^3: Negative zero? There's gotta be a sprintf that undoes that, right?
  • Download Code