[with patch, with positive review] technically incorrect code in integer_mod.pyx
|Reported by:||cwitty||Owned by:||somebody|
|Report Upstream:||Work issues:|
There is code in integer_mod.pyx that coerces a Python int into an int_fast32_t. This is wrong, since a Python int can hold a C long; so this might truncate if sizeof(int_fast32_t) < sizeof(long).
However, the bug has little or no practical effect, since:
1) on 64-bit x86 Linux, sizeof(int_fast32_t) == sizeof(long);
2) the problem only occurs if you call IntegerMod_int directly (which nobody should); it looks like all the wrappers do the modulo before they create the IntegerMod_int.
Change History (3)
Changed 7 years ago by cwitty
comment:1 Changed 7 years ago by robertwb
- Component changed from algebraic geometry to basic arithmetic
- Owner changed from was to somebody
- Summary changed from [with patch] technically incorrect code in integer_mod.pyx to [with patch, with positive review] technically incorrect code in integer_mod.pyx