diff options
author | Damien George <damien.p.george@gmail.com> | 2015-08-20 23:42:35 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-10-20 12:35:17 +0100 |
commit | 7e359c648b1f92e709c5ff4b7089011967ebb9f5 (patch) | |
tree | c931595a8e46512c83d5e77b5a8aa14ff5810b9c /py/modcmath.c | |
parent | aaef1851a748af95f8b105ef2d1d4f35e6ede02b (diff) |
py: Move float e/pi consts to objfloat and make mp_obj_float_t private.
Diffstat (limited to 'py/modcmath.c')
-rw-r--r-- | py/modcmath.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/py/modcmath.c b/py/modcmath.c index 46a33d3a8..089210d06 100644 --- a/py/modcmath.c +++ b/py/modcmath.c @@ -35,12 +35,6 @@ /// The `cmath` module provides some basic mathematical funtions for /// working with complex numbers. -// These are defined in modmath.c -/// \constant e - base of the natural logarithm -extern const mp_obj_float_t mp_math_e_obj; -/// \constant pi - the ratio of a circle's circumference to its diameter -extern const mp_obj_float_t mp_math_pi_obj; - /// \function phase(z) /// Returns the phase of the number `z`, in the range (-pi, +pi]. STATIC mp_obj_t mp_cmath_phase(mp_obj_t z_obj) { @@ -132,8 +126,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_sin_obj, mp_cmath_sin); STATIC const mp_map_elem_t mp_module_cmath_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_cmath) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_e), (mp_obj_t)&mp_math_e_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_pi), (mp_obj_t)&mp_math_pi_obj }, + { MP_OBJ_NEW_QSTR(MP_QSTR_e), mp_const_float_e }, + { MP_OBJ_NEW_QSTR(MP_QSTR_pi), mp_const_float_pi }, { MP_OBJ_NEW_QSTR(MP_QSTR_phase), (mp_obj_t)&mp_cmath_phase_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_polar), (mp_obj_t)&mp_cmath_polar_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_rect), (mp_obj_t)&mp_cmath_rect_obj }, |