Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re4: Filthy Floats

by I0 (Priest)
on Jul 17, 2001 at 22:16 UTC ( [id://97396]=note: print w/replies, xml ) Need Help??


in reply to Re4: Filthy Floats
in thread Filthy Floats

Round to even is best for bases equal to 2 mod 4, e.g. base 2 or base 10
Round to odd would be best for bases equal to 0 mod 4
printf "%.20f => %.0f", 0.5, 0.5; # prints 0.50000000000000000000 => 1
Looks to me like a bug in printf...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (None)
    As of 2024-04-25 01:33 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found