Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Negative zero? There's gotta be a sprintf that undoes that, right?

by Roy Johnson (Monsignor)
on Dec 12, 2007 at 19:17 UTC ( [id://656690]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://656690]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found