diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-04 11:13:51 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-04 11:13:51 +0000 |
commit | ecf5b771230ef747773aa54960ebc2a46902a0ed (patch) | |
tree | 904c8ff0678ca81906bb871aa9375954cc2c338c /py/smallint.h | |
parent | 6902eeda259a5ed8fe3a5ce5cb19ba9207549d33 (diff) |
py: This time, real proper overflow checking of small int power.
Previous overflow test was inadequate.
Diffstat (limited to 'py/smallint.h')
-rw-r--r-- | py/smallint.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/smallint.h b/py/smallint.h new file mode 100644 index 000000000..14234fa7b --- /dev/null +++ b/py/smallint.h @@ -0,0 +1,5 @@ +// Functions for small integer arithmetic + +bool mp_small_int_mul_overflow(machine_int_t x, machine_int_t y); +machine_int_t mp_small_int_modulo(machine_int_t dividend, machine_int_t divisor); +machine_int_t mp_small_int_floor_divide(machine_int_t num, machine_int_t denom); |