sdiehl / numpile

A tiny 1000 line LLVM-based numeric specializer for scientific Python code.
http://dev.stephendiehl.com/numpile/
MIT License
404 stars 52 forks source link

fix overflow bug in the dot product #2

Open btel opened 9 years ago

btel commented 9 years ago

The dot example gives wrong result due to an overflow in int32 accumulator. This PR fixes it by working with int64 arrays instead. To make this change feasible the following changes were implemented:

btel commented 9 years ago

Great tutorial! Thanks for the work.

btel commented 9 years ago

BTW I did not have time to update numpile.py, but it should be easily done.

sdiehl commented 9 years ago

It's hard to read the git diff for the changes to the type inference from the IPython notebook dump. Can you make the change in numpile.py?

btel commented 9 years ago

done! you should see it in the PR.

sdiehl commented 9 years ago

LGTM, I'll just pull it and make sure everything builds fine.