Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Negative zero? There's gotta be a sprintf that undoes that, right? (0+"$x")

by suaveant (Parson)
on Dec 12, 2007 at 14:01 UTC ( [id://656626]=note: print w/replies, xml ) Need Help??


in reply to Re: Negative zero? There's gotta be a sprintf that undoes that, right? (0+"$x")
in thread Negative zero? There's gotta be a sprintf that undoes that, right?

Ahh... but further testing shows that
printf "%f\n", 0+"-0.0"; 0.000000 printf "%f\n", 0+"-0.00000009"; -0.000000
I have a feeling this has to do with something lower than actual negative zero being numerified as a negative number, THEN going through printf, which undoes all that extra work.

                - Ant
                - Some of my best work - (1 2 3)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-03-28 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found