cy99 / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

When Integers grow big. #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I created this simple test.py program:

#!/usr/bin/python

suma = 0

for i in range(0,10000,2):
  suma += i

print suma

2. The output of this program is 24995000, same as the output of the
shedskin C++ compiled version of the program.

3. However, the output is not the same when the range is increased to 100000.

What is the expected output? What do you see instead?
The expected output with a 100000 iterations loop is 2499950000 as the
python program will output if you run it. The shedskin version of the
modified program shows, on the oher hand, -1795017296.

I have to say that in the first case, shedskin provided a speedup of 20X,
which was pretty nice but, in the second case, it was python who knew how
to handle the bigger value and still output the correct computation.

What version of the product are you using? On what operating system?
shedskin_0.2-0ubuntu1_all-1.deb on Ubuntu 9.04

Please provide any additional information below.
Initializing "suma" to 0.0 instead of 0 makes the output of shedskin go
from "int suma" to "double suma" but the output remains the same.

Keep up the good work,
Carlos

Original issue reported on code.google.com by dr.chamb...@gmail.com on 7 Oct 2009 at 1:54

GoogleCodeExporter commented 9 years ago
thanks for the feedback!

unfortunately, arbitrarily large numbers are officially not supported at the 
moment..
please see the tutorial for an overview of all the limitations of using 
shedskin.

Original comment by mark.duf...@gmail.com on 8 Oct 2009 at 2:54