[Tutor] Float number accuracy

Julia midnightjulia at gmail.com
Fri Jul 11 00:42:01 CEST 2008


On Thu, Jul 10, 2008 at 11:21 PM, Kent Johnson <kent37 at tds.net> wrote:

> 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


Thanks, I've just found (what seems to be) a workaround :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080711/c9e18b7e/attachment-0001.htm>


More information about the Tutor mailing list