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/objfloat.c | |
parent | aaef1851a748af95f8b105ef2d1d4f35e6ede02b (diff) |
py: Move float e/pi consts to objfloat and make mp_obj_float_t private.
Diffstat (limited to 'py/objfloat.c')
-rw-r--r-- | py/objfloat.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/py/objfloat.c b/py/objfloat.c index 268fe8984..f01bfe72b 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -39,6 +39,14 @@ #include <math.h> #include "py/formatfloat.h" +typedef struct _mp_obj_float_t { + mp_obj_base_t base; + mp_float_t value; +} mp_obj_float_t; + +const mp_obj_float_t mp_const_float_e_obj = {{&mp_type_float}, M_E}; +const mp_obj_float_t mp_const_float_pi_obj = {{&mp_type_float}, M_PI}; + STATIC void float_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { (void)kind; mp_obj_float_t *o = o_in; |