- Sep 26, 2018
-
-
Christopher Swenson authored
This commit adds the math.factorial function in two variants: - squared difference, which is faster than the naive version, relatively compact, and non-recursive; - a mildly optimised recursive version, faster than the above one. There are some more optimisations that could be done, but they tend to take more code, and more storage space. The recursive version seems like a sensible compromise. The new function is disabled by default, and uses the non-optimised version by default if it is enabled. The options are MICROPY_PY_MATH_FACTORIAL and MICROPY_OPT_MATH_FACTORIAL.
-
- Sep 20, 2018
-
-
Damien George authored
-
- Oct 10, 2017
-
-
Damien George authored
So that a pointer to it can be passed as a pointer to math_generic_1. This patch also makes the function work for single and double precision floating point.
-
Damien George authored
This patch changes how most of the plain math functions are implemented: there are now two generic math wrapper functions that take a pointer to a math function (like sin, cos) and perform the necessary conversion to and from MicroPython types. This helps to reduce code size. The generic functions can also check for math domain errors in a generic way, by testing if the result is NaN or infinity combined with finite inputs. The result is that, with this patch, all math functions now have full domain error checking (even gamma and lgamma) and code size has decreased for most ports. Code size changes in bytes for those with the math module are: unix x64: -432 unix nanbox: -792 stm32: -88 esp8266: +12 Tests are also added to check domain errors are handled correctly.
-
- Aug 30, 2017
-
-
Damien George authored
This comment style is no longer used because the docs are written by hand, not generated.
-
- Jul 31, 2017
-
-
Alexander Steffen authored
There were several different spellings of MicroPython present in comments, when there should be only one.
-
- Jul 03, 2017
-
-
Damien George authored
-
- Jun 15, 2017
-
-
Damien George authored
-
- Mar 23, 2017
-
-
Damien George authored
Previous to this patch, if the result of the trunc/ceil/floor functions overflowed a small int, or was inf or nan, then a garbage value was returned. With this patch the correct big-int is returned if necessary, and exceptions are raised for inf or nan.
-
- Nov 03, 2016
-
-
Damien George authored
All float constants in the core should use this macro to prevent unnecessary creation of double-precision floats, which makes code less efficient.
-
- Sep 21, 2016
-
-
Damien George authored
One can instead lookup __name__ in the modules dict to get the value.
-
- May 12, 2016
-
-
Colin Hogben authored
In some compliation enviroments (e.g. mbed online compiler) with strict standards compliance, <math.h> does not define constants such as M_PI. Provide fallback definitions of M_E and M_PI where needed.
-
- Jan 11, 2016
-
-
Damien George authored
With this patch the n_args parameter is changed type from mp_uint_t to size_t.
-
- Dec 12, 2015
-
-
Michael Buesch authored
These functions will raise 'ValueError: math domain error' on invalid input.
-
- Nov 29, 2015
-
-
Damien George authored
-
- Nov 17, 2015
-
-
Damien George authored
Will be included only when MICROPY_PY_MATH_SPECIAL_FUNCTIONS is enabled. Also covers cmath module (but only log10 is there at the moment).
-
- Nov 13, 2015
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
It's safer to define it where it's used, defining it for all source files may lead to hard to diagnose conflicts in corner cases.
-
- Oct 20, 2015
-
-
Damien George authored
-
- Oct 11, 2015
-
-
Paul Sokolovsky authored
-
- Jun 13, 2015
-
-
Damien George authored
-
- Feb 22, 2015
-
-
Damien George authored
The implementation of these functions is very large (order 4k) and they are rarely used, so we don't enable them by default. They are however enabled in stmhal and unix, since we have the room.
-
- Jan 01, 2015
-
-
Damien George authored
Addresses issue #1022.
-
- Dec 10, 2014
-
-
Damien George authored
-
- Nov 29, 2014
-
-
Damien George authored
This is just a clean-up of the code. Generated code is exactly the same.
-
- Aug 10, 2014
-
-
Damien George authored
-
- Jul 03, 2014
-
-
Damien George authored
See discussion in issue #50.
-
- Jun 21, 2014
-
-
Paul Sokolovsky authored
It defines types used by all other headers. Fixes #691.
-
- Jun 19, 2014
-
-
Emmanuel Blot authored
-
- Jun 01, 2014
-
-
Damien George authored
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.
-
- May 24, 2014
-
-
Damien George authored
Now of the form MICROPY_PY_*. See issue #35.
-
- May 12, 2014
-
-
Antonin ENFRUN authored
Fix some unused variables, and silence a clang warning about initialization override in vmentrytable.h
-
- May 03, 2014
-
-
Damien George authored
Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
-
- Apr 26, 2014
-
-
Damien George authored
-
- Apr 17, 2014
-
-
Damien George authored
Not all functions implemented. Not enabled on pyboard.
-
- Apr 05, 2014
-
-
Damien George authored
Towards addressing issue #424. Had a small increase to ROM usage (order 60 bytes).
-
- Apr 01, 2014
-
-
Damien George authored
-
- Mar 30, 2014
-
-
Damien George authored
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.
-
- Mar 25, 2014
-
-
Damien George authored
Comes with some refactoring of code and renaming of files. All modules are now named mod*.[ch].
-