[Tutor] Float number accuracy

Kent Johnson kent37 at tds.net
Thu Jul 10 23:21:58 CEST 2008


On Thu, Jul 10, 2008 at 4:41 PM, Julia <midnightjulia at gmail.com> wrote:
> I've done this:
>
>>>> c = float
>>>> c
> <type 'float'>

This is not needed, Python variables do not have types (it is the
values that have type).

>>>> c = 3.3
>>>> c
> 3.2999999999999998
>
> I've done it with and without the c = float and still it rounds the number
> down. Why?

See http://docs.python.org/tut/node16.html

Kent


More information about the Tutor mailing list