diff options
Diffstat (limited to 'tools/mpy-tool.py')
-rwxr-xr-x | tools/mpy-tool.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py index 0a9246503e..43d35503eb 100755 --- a/tools/mpy-tool.py +++ b/tools/mpy-tool.py @@ -332,12 +332,13 @@ class RawCode(object): "#if MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_A || MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_B" ) print( - "STATIC const mp_obj_float_t %s = {{&mp_type_float}, %.16g};" % (obj_name, obj) + "STATIC const mp_obj_float_t %s = {{&mp_type_float}, (mp_float_t)%.16g};" + % (obj_name, obj) ) print("#endif") elif type(obj) is complex: print( - "STATIC const mp_obj_complex_t %s = {{&mp_type_complex}, %.16g, %.16g};" + "STATIC const mp_obj_complex_t %s = {{&mp_type_complex}, (mp_float_t)%.16g, (mp_float_t)%.16g};" % (obj_name, obj.real, obj.imag) ) else: |