Damien George
51dfcb4bb7
py: Move to guarded includes, everywhere in py/ core.
...
Addresses issue #1022 .
2015-01-01 20:32:09 +00:00
Paul Sokolovsky
f79cd6a233
py: Implement mp_obj_new_int_from_float() for MICROPY_LONGINT_IMPL_NONE.
2014-12-30 00:33:32 +02:00
Paul Sokolovsky
12033df511
py: Partially fix float to int conversion.
...
This fixes conversion when float type has more mantissa bits than small int,
and float value has small exponent. This is for example the case of 32-bit
platform using doubles, and converting value of time.time(). Conversion of
floats with larg exponnet is still not handled correctly.
2014-12-30 00:22:50 +02:00
Damien George
be6d8be91e
py: Rename mp_obj_int_get to mp_obj_int_get_truncated; fix struct.pack.
...
mp_obj_int_get_truncated is used as a "fast path" int accessor that
doesn't check for overflow and returns the int truncated to the machine
word size, ie mp_int_t.
Use mp_obj_int_get_truncated to fix struct.pack when packing maximum word
sized values.
Addresses issues #779 and #998 .
2014-12-05 23:13:52 +00:00
Damien George
fcdb239815
py: Make int.to_bytes work on big endian machine.
...
Partly addresses issue #856 .
2014-10-06 13:45:34 +00:00
Damien George
42f3de924b
py: Convert [u]int to mp_[u]int_t where appropriate.
...
Addressing issue #50 .
2014-10-03 17:44:14 +00:00
Damien George
953074315e
py: Enable struct/binary-helper to parse q and Q sized ints.
...
Addresses issue #848 .
2014-09-10 22:10:33 +01:00
Damien George
4abff7500f
py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h.
...
Part of code cleanup, working towards resolving issue #50 .
2014-08-30 14:59:21 +01:00
Damien George
d182b98a37
py: Change all uint to mp_uint_t in obj.h.
...
Part of code cleanup, working towards resolving issue #50 .
2014-08-30 14:19:41 +01:00
Damien George
1c70cbf151
py: Save about 200 bytes of ROM by using smaller type for static table.
2014-08-30 00:38:16 +01:00
Damien George
ecc88e949c
Change some parts of the core API to use mp_uint_t instead of uint/int.
...
Addressing issue #50 , still some way to go yet.
2014-08-30 00:35:11 +01:00
Damien George
a75b02ea9b
py: Improve efficiency of MP_OBJ_IS_STR_OR_BYTES.
...
Saves ROM (16 on stmhal, 240 on 64-bit unix) and should be quicker since
there is 1 less branch.
2014-08-27 09:20:30 +01:00
Dave Hylands
b7f7c655ed
Make int(b'123') work properly.
2014-08-26 19:15:04 -07:00
Damien George
9b7a8ee8f1
py: Fix mult by negative number of tuple, list, str, bytes.
...
Multiplication of a tuple, list, str or bytes now yields an empty
sequence (instead of crashing). Addresses issue #799
Also added ability to mult bytes on LHS by integer.
2014-08-13 13:22:24 +01:00
Damien George
bb4c6f35c6
py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.
...
Addresses issue #724 .
2014-07-31 10:49:14 +01:00
Damien George
ffe911d228
py: Make long ints hashable.
...
Addresses issue #765 .
2014-07-24 14:21:37 +01:00
Damien George
40f3c02682
Rename machine_(u)int_t to mp_(u)int_t.
...
See discussion in issue #50 .
2014-07-03 13:25:24 +01:00
Paul Sokolovsky
d72bc2713a
objint: Fix corner case in buffer access.
2014-06-06 23:08:37 +03:00
Damien George
fb510b3bf9
Rename bultins config variables to MICROPY_PY_BUILTINS_*.
...
This renames:
MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET
MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY
MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE
MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT
See issue #35 for discussion.
2014-06-01 13:32:54 +01:00
Damien George
d1e355ea8e
py: Fix check of small-int overflow when parsing ints.
...
Also unifies use of SMALL_INT_FITS macro across parser and runtime.
2014-05-28 14:51:12 +01:00
Damien George
813ed3bda6
py: Make int(<longint>) work by just returning the longint.
2014-05-28 14:09:46 +01:00
Damien George
503d611033
py: Implement long int parsing in int(...).
...
Addresses issue #627 .
2014-05-28 14:07:21 +01:00
Damien George
6ac5dced24
py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL.
...
See issue #608 for justification.
2014-05-21 19:42:43 +01:00
Sven Wegener
7ba0fedf13
py: Fix mp_obj_t -> mp_const_obj_t for mp_obj_int_get_checked()
...
Signed-off-by: Sven Wegener <sven.wegener@stealer.net >
2014-05-17 11:21:12 +02:00
Paul Sokolovsky
ab7bf28489
py: More const usage.
2014-05-17 11:20:10 +03:00