diff options
author | stijn <stijn@ignitron.net> | 2020-03-31 14:48:08 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-04-18 22:42:24 +1000 |
commit | bcf01d1686a8fa6d257daea25ce0d7df6e4ad839 (patch) | |
tree | 2513c71e685ead21c6ca44a0432500ca75c424f8 /py/formatfloat.c | |
parent | dc4d119d3d96799bf848c6488b2ac49b933ab7cb (diff) |
all: Fix implicit conversion from double to float.
These are found when building with -Wfloat-conversion.
Diffstat (limited to 'py/formatfloat.c')
-rw-r--r-- | py/formatfloat.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/formatfloat.c b/py/formatfloat.c index 50fc0da4b..9d28b2317 100644 --- a/py/formatfloat.c +++ b/py/formatfloat.c @@ -100,15 +100,15 @@ static inline int fp_isless1(float x) { static const FPTYPE g_pos_pow[] = { #if FPDECEXP > 32 - 1e256, 1e128, 1e64, + MICROPY_FLOAT_CONST(1e256), MICROPY_FLOAT_CONST(1e128), MICROPY_FLOAT_CONST(1e64), #endif - 1e32, 1e16, 1e8, 1e4, 1e2, 1e1 + MICROPY_FLOAT_CONST(1e32), MICROPY_FLOAT_CONST(1e16), MICROPY_FLOAT_CONST(1e8), MICROPY_FLOAT_CONST(1e4), MICROPY_FLOAT_CONST(1e2), MICROPY_FLOAT_CONST(1e1) }; static const FPTYPE g_neg_pow[] = { #if FPDECEXP > 32 - 1e-256, 1e-128, 1e-64, + MICROPY_FLOAT_CONST(1e-256), MICROPY_FLOAT_CONST(1e-128), MICROPY_FLOAT_CONST(1e-64), #endif - 1e-32, 1e-16, 1e-8, 1e-4, 1e-2, 1e-1 + MICROPY_FLOAT_CONST(1e-32), MICROPY_FLOAT_CONST(1e-16), MICROPY_FLOAT_CONST(1e-8), MICROPY_FLOAT_CONST(1e-4), MICROPY_FLOAT_CONST(1e-2), MICROPY_FLOAT_CONST(1e-1) }; int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, char sign) { |