On 2022-12-17 21:45:06 +0100, Paul St George wrote: > It was the rounding rounding error that I needed to avoid (as Peter J. > Holzer suggested). The use of decimal solved it and just in time. I > was about to truncate the number, get each of the characters from the > string mantissa, and then do something like this: > > 64550.727 > > 64550 + (7 * 0.1) + (2 * 0.01) + (7 * 0.001)
That wouldn't have helped. In fact it would have made matters worse because instead of a single rounding operation you now have nine! hp -- _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | h...@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!"
signature.asc
Description: PGP signature
-- https://mail.python.org/mailman/listinfo/python-list