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.... :-)