clp2 at rebertia.com
Thu Aug 12 23:28:41 CEST 2010
On Thu, Aug 12, 2010 at 1:43 PM, Bradley Hintze
<bradley.h at aggiemail.usu.edu> wrote:
> Hi all.
> Is there a way I can keep my floating point number as I typed it? For
> example, I want 34.52 to be 34.52 and NOT 34.5200000002.
<stuff repeating Gary's answer redacted>
See also: http://en.wikipedia.org/wiki/Floating_point#Representable_numbers.2C_conversion_and_rounding
Another option is to use the `decimal` module, which *can* exactly
represent decimal numbers (to a user-specified finite precision) and
is generally a bit more intuitive but /substantially/ slower:
More information about the Python-list