Dave Hylands
c4029e5079
Add string formatting support for longlong and mpz.
11 years ago
Damien George
ea13f407a3
py: Change nlr_jump to nlr_raise, to aid in debugging.
This does not affect code size or performance when debugging turned off.
To address issue #420 .
11 years ago
Damien George
e8208a7f02
py: Make False and True act like 0 and 1 for integer arithmetic.
11 years ago
Damien George
ecf5b77123
py: This time, real proper overflow checking of small int power.
Previous overflow test was inadequate.
11 years ago
Damien George
8270e3853d
py: More robust int conversion and overflow checking.
11 years ago
Damien George
660aef67c4
py: Allow multiple of str/list/tuple on left by an integer.
11 years ago
Damien George
d17926db71
Rename rt_* to mp_*.
Mostly just a global search and replace. Except rt_is_true which
becomes mp_obj_is_true.
Still would like to tidy up some of the names, but this will do for now.
11 years ago
Damien George
0aa5d51cf1
py: Support mpz -op- float, mpz -op- complex, and complex -op- mpz.
11 years ago
Damien George
3e1a5c10c5
py: Rename old const type objects to mp_type_* for consistency.
11 years ago
Paul Sokolovsky
57207b8818
objint_mpz: Quick&dirty implementation of bitwise operations.
Made solely to unbreak int-long.py test which in turn uncovered thinko
with implementation of inplace ops. On mpz level, bitwise ops implemented
only for same-sign numbers, and are not efficient (unconditional calling of
mpn_cmp() is apparently superfluous).
11 years ago
Damien George
eabdf6718a
py: Add function to convert long int to float.
11 years ago
Rachel Dowdall
2d15deebdc
Fixed floor division on mp ints and small ints. Added a floordivide test case.
11 years ago
Rachel Dowdall
56402796d8
Fixed floor division on mp ints and small ints. Added a floordivide test case.
11 years ago
Rachel Dowdall
cde8631f15
Fixed modulo operator on ints and mp ints to agree with python. Added intdivmod.c and tests/basics/modulo.py.
11 years ago
Damien George
2d7ff07175
py: Add mpz modulo operation.
11 years ago
Damien George
cd8b2baf43
py: Fix bug in mpz int, where small int is on lhs, mpz on rhs.
11 years ago
xbe
efe3422394
py: Clean up includes.
Remove unnecessary includes. Add includes that improve portability.
11 years ago
Damien George
9d68e9ccdd
py: Implement integer overflow checking for * and << ops.
If operation will overflow, a multi-precision integer is created.
11 years ago
Damien George
5260810d70
py: Wrap mpz float functions in MICROPY_ENABLE_FLOAT.
11 years ago
Damien George
06201ff3d6
py: Implement bit-shift and not operations for mpz.
Implement not, shl and shr in mpz library. Add function to create mpzs
on the stack, used for memory efficiency when rhs is a small int.
Factor out code to parse base-prefix of number into a dedicated function.
11 years ago
Damien George
438c88dd2f
Add arbitrary precision integer support.
Some functionality is still missing (eg and, or, bit shift), and some
things are buggy (eg subtract).
11 years ago