diff options
author | stijn <stijn@ignitron.net> | 2019-11-20 13:38:33 +0100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-01-23 09:28:33 +1100 |
commit | dd6967202a734fce569127c07da7ed1e07ce8bc4 (patch) | |
tree | c6519e4f19dbf70efc0c99fd4f4f0e3a3c3f13b7 /py/modmath.c | |
parent | e0b8d6982713c78169ec882770e746f2c5f4bc30 (diff) |
py/modmath: Add math.tau, math.nan and math.inf constants.
Configurable by the new MICROPY_PY_MATH_CONSTANTS option.
Diffstat (limited to 'py/modmath.c')
-rw-r--r-- | py/modmath.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/modmath.c b/py/modmath.c index ac9e0bbc4..8fc821c9d 100644 --- a/py/modmath.c +++ b/py/modmath.c @@ -371,6 +371,11 @@ STATIC const mp_rom_map_elem_t mp_module_math_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_math) }, { MP_ROM_QSTR(MP_QSTR_e), mp_const_float_e }, { MP_ROM_QSTR(MP_QSTR_pi), mp_const_float_pi }, + #if MICROPY_PY_MATH_CONSTANTS + { MP_ROM_QSTR(MP_QSTR_tau), mp_const_float_tau }, + { MP_ROM_QSTR(MP_QSTR_inf), mp_const_float_inf }, + { MP_ROM_QSTR(MP_QSTR_nan), mp_const_float_nan }, + #endif { MP_ROM_QSTR(MP_QSTR_sqrt), MP_ROM_PTR(&mp_math_sqrt_obj) }, { MP_ROM_QSTR(MP_QSTR_pow), MP_ROM_PTR(&mp_math_pow_obj) }, { MP_ROM_QSTR(MP_QSTR_exp), MP_ROM_PTR(&mp_math_exp_obj) }, |