summaryrefslogtreecommitdiff
path: root/py/objcomplex.c
AgeCommit message (Collapse)Author
2014-05-02py, unix: Make "mpconfig.h" be first included, as other headers depend on it.Paul Sokolovsky
Specifically, nlr.h does.
2014-04-17py: Add MP_OBJ_STOP_ITERATION and make good use of it.Damien George
Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL. This helps a lot in debugging and understanding of function API.
2014-04-11py: Implement float and complex == and !=.Damien George
Addresses issue #462.
2014-04-10py: Fix float/complex binop returning NULL; implement complex power.Damien George
2014-04-09py: Implement complex division.Damien George
2014-04-05py: Change nlr_jump to nlr_raise, to aid in debugging.Damien George
This does not affect code size or performance when debugging turned off. To address issue #420.
2014-03-30Merge map.h into obj.h.Damien George
Pretty much everyone needs to include map.h, since it's such an integral part of the Micro Python object implementation. Thus, the definitions are now in obj.h instead. map.h is removed.
2014-03-30Rename rt_* to mp_*.Damien George
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.
2014-03-29py: Fix typo printing complex numbers that are purely imaginary.Damien George
2014-03-27py: Fix typo printing complex numbers.Damien George
2014-03-27py: complex_print uses format_float if single precision fp used.Damien George
2014-03-21py: Allow 'complex()' to take a string as first argument.Damien George
2014-03-17py: Clean up includes.xbe
Remove unnecessary includes. Add includes that improve portability.
2014-03-08Implement ROMable modules. Add math module.Damien George
mp_module_obj_t can now be put in ROM. Configuration of float type is now similar to longint: can now choose none, float or double as the implementation. math module has basic math functions. For STM port, these are not yet implemented (they are just stub functions).
2014-02-15Implement proper exception type hierarchy.Damien George
Each built-in exception is now a type, with base type BaseException. C exceptions are created by passing a pointer to the exception type to make an instance of. When raising an exception from the VM, an instance is created automatically if an exception type is raised (as opposed to an exception instance). Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper. Handling of parse error changed to match new exceptions. mp_const_type renamed to mp_type_type for consistency.
2014-02-15Change mp_obj_type_t.name from const char * to qstr.Damien George
Ultimately all static strings should be qstr. This entry in the type structure is only used for printing error messages (to tell the type of the bad argument), and printing objects that don't supply a .print method.
2014-02-12Remove mp_obj_new_exception_msg_1_arg and _2_arg.Damien George
2014-02-12Replace global "static" -> "STATIC", to allow "analysis builds". Part 1.Paul Sokolovsky
Some tools do not support local/static symbols (one example is GNU ld map file). Exposing all functions will allow to do detailed size comparisons, etc. Also, added bunch of statics where they were missing, and replaced few identity functions with global mp_identity().
2014-01-30Implement __bool__ and __len__ via unary_op virtual method for all types.Paul Sokolovsky
__bool__() and __len__() are just the same as __neg__() or __invert__(), and require efficient dispatching implementation (not requiring search/lookup). type->unary_op() is just the right choice for this short of adding standalone virtual method(s) to already big mp_obj_type_t structure.
2014-01-27Fix implicit double conversion warningmux
2014-01-21Revamp qstrs: they now include length and hash.Damien George
Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
2014-01-18Make VM stack grow upwards, and so no reversed args arrays.Damien George
Change state layout in VM so the stack starts at state[0] and grows upwards. Locals are at the top end of the state and number downwards. This cleans up a lot of the interface connecting the VM to C: now all functions that take an array of Micro Python objects are in order (ie no longer in reverse). Also clean up C API with keyword arguments (call_n and call_n_kw replaced with single call method that takes keyword arguments). And now make_new takes keyword arguments. emitnative.c has not yet been changed to comply with the new order of stack layout.
2014-01-15type->print(): Distinguish str() and repr() variety by passing extra param.Paul Sokolovsky
2014-01-07Merge branch 'cplusplus' of https://github.com/ian-v/micropython into ↵Damien George
ian-v-cplusplus Conflicts: py/objcomplex.c
2014-01-06py: Fix up number operations and coercion.Damien George
2014-01-06Co-exist with C++ (issue #85)ian-v
2014-01-05Convert many object types structs to use C99 tagged initializer syntax.Paul Sokolovsky
2014-01-04Convert Python types to proper Python type hierarchy.Damien George
Now much more inline with how CPython does types.
2013-12-21Change object representation from 1 big union to individual structs.Damien
A big change. Micro Python objects are allocated as individual structs with the first element being a pointer to the type information (which is itself an object). This scheme follows CPython. Much more flexible, not necessarily slower, uses same heap memory, and can allocate objects statically. Also change name prefix, from py_ to mp_ (mp for Micro Python).