Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re4: Using (s)printf()

by Hofmator (Curate)
on Sep 03, 2001 at 15:32 UTC ( [id://109845]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Using (s)printf()
in thread Using (s)printf()

Actually, this isn't quite the whole story. Most everyone follows the IEEE convention of "round towards nearest or even."
I'm aware of that - but it wasn't applicable in this case. Btw, (s)printf doesn't seem to get it right:
printf "%.15f", 0.5; # prints 0.500000000000000 printf "%.0f", 0.5; # prints 1 and should print 0
and 0.5 can be represented exactly ...

-- Hofmator

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2024-09-13 12:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (20 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.