Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Yet again: floats are not expressed accurately

by bliako (Monsignor)
on Mar 21, 2023 at 15:13 UTC ( [id://11151105]=note: print w/replies, xml ) Need Help??


in reply to Re: Yet again: floats are not expressed accurately
in thread Yet again: floats are not expressed accurately

Thank you pryrt. One reason to pursue this further (i.e. bothering all of you here) was that C was not showing it, but as you showed, my mistake! was not to use double precision like my perl does. I have used your POSIX::round suggestion yesterday and it did work. Also, with Perl's easy numerical <-> string conversions it's easy to go to cents by a string-manipulation route (remove and add the dot) and avoid even getting the cents wrong as was in my case. So, yes thanks and thanks to all for their input and suggestions.

  • Comment on Re^2: Yet again: floats are not expressed accurately

Replies are listed 'Best First'.
Re^3: Yet again: floats are not expressed accurately
by bibliophile (Prior) on Mar 21, 2023 at 18:37 UTC
    A unique position where it both makes cents, and doesn't make scents.... :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-26 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found