Decimals not equalling themselves (e.g. 0.2 = 0.2000000001)

schinckel matt at schinckel.net
Tue Aug 5 10:50:43 EDT 2008


On Aug 5, 3:26 pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar> wrote:
> En Sun, 03 Aug 2008 19:57:10 -0300, Grant Edwards <gra... at visi.com>  
> escribi :
>
> > On 2008-08-03, Larry Bates <larry.ba... at websafe.com`> wrote:
>
> >> What are they teaching in computer science classes these days?
>
> > When I was an undergrad the only courses that dealt with FP
> > issues were classes on numerical analysis.  I don't even know
> > if numerical analysis classes were required for CS majors.  I
> > think most of us in that class were engineering majors.
>
> And even if those topics were always covered in CS classes, a CS degree  
> isn't required to program in Python - fortunately.
>

I had a class today which dealt with Decimal <-> IEE754 conversion,
and
whilst 0.1 was an example that was converted, and a representation was
generated, no mention was made of the precision issue.

I'm hoping that it was just that we ran out of time, and the lecturer
will discuss it in detail next time.

Matt.




More information about the Python-list mailing list