[Tutor] crash when importing random or sys module, in my embedded python

Magnus Lyckå magnus@thinkware.se
Thu Jun 19 21:24:02 2003


At 20:58 2003-06-19 -0400, R. Alan Monroe wrote:
>and the error with %r:
>('computed value for TWOPI deviates too much (computed 6.2831854820251465, 
>expected 6.2831853071800001)',)

That's odd.  That would make pi = 3.1415927410125732
My old school book says that pi = 3.14159265358979323846...

You're quite far off. You don't have any non-standard
math.py that you happen to import, do you?

On my machine 2*pi = 6.2831853071795862

6.2831853071795862 and
6.2831854820251465 are obviously different enough...

Are you sure that "import math; print math.pi*2" gave
the same result as it did for me? In your embedded
version? Is your embedded version somehow using single
precision floating points instead of double?

You don't have anything else in your version of random.py
than "from math import ... pi as _pi ... TWOPI = 2.0 * _pi"
do you?


--
Magnus Lycka (It's really Lyckå), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language