precision of float in a dict

Steve Holden sholden at holdenweb.com
Fri May 23 09:34:16 EDT 2003


"Sven Brandt" <sven_NOSPAM at manastar.de> wrote in message
news:bal46v$es9$1 at online.de...
> Hi,
>
> has a float value in a dictionary a lesser precision than 'outside'?
>
> E.g.
>
>    my_float=0.1
>    my_dict={'my_value':my_float}
>    print my_float
>    print my_dict
>    return printed
>
> returns
>
> 0.1
> {'my_value': 0.10000000000000001}
>
> Since I'm doing some (small scale) accounting using Python I was just
> wondering ...
>

http://www.python.org/cgi-bin/faqw.py?req=show&file=faq04.098.htp

regards
--
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/







More information about the Python-list mailing list