diff options
Diffstat (limited to 'py')
-rw-r--r-- | py/formatfloat.c (renamed from py/format-float.c) | 18 | ||||
-rw-r--r-- | py/formatfloat.h (renamed from py/format-float.h) | 2 | ||||
-rw-r--r-- | py/objfloat.c | 5 | ||||
-rw-r--r-- | py/py.mk | 2 |
4 files changed, 13 insertions, 14 deletions
diff --git a/py/format-float.c b/py/formatfloat.c index 5411ae24f6..e42266a714 100644 --- a/py/format-float.c +++ b/py/formatfloat.c @@ -1,25 +1,25 @@ -/*********************************************************************** - - format-float.c - Ruutine for converting a single-precision floating +/*********************************************************************** + + formatfloat.c - Ruutine for converting a single-precision floating point number into a string. - + The code in this funcion was inspired from Fred Bayer's pdouble.c. Since pdouble.c was released as Public Domain, I'm releasing this code as public domain as well. - + The original code can be found in https://github.com/dhylands/format-float - + Dave Hylands - + ***********************************************************************/ -#include <stdint.h> +#include <stdint.h> #include <stdlib.h> #include "mpconfig.h" #if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT -#include "format-float.h" +#include "formatfloat.h" // 1 sign bit, 8 exponent bits, and 23 mantissa bits. // exponent values 0 and 255 are reserved, exponent can be 1 to 254. diff --git a/py/format-float.h b/py/formatfloat.h index 590fb0e91d..4c2c30e53c 100644 --- a/py/format-float.h +++ b/py/formatfloat.h @@ -1,3 +1 @@ int format_float(float f, char *buf, size_t bufSize, char fmt, int prec, char sign); - - diff --git a/py/objfloat.c b/py/objfloat.c index 5b953f05eb..91d669ad58 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -12,8 +12,9 @@ #include "runtime0.h" #if MICROPY_ENABLE_FLOAT + #if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT -#include "format-float.h" +#include "formatfloat.h" #endif mp_obj_t mp_obj_new_float(mp_float_t value); @@ -120,4 +121,4 @@ mp_obj_t mp_obj_float_binary_op(int op, mp_float_t lhs_val, mp_obj_t rhs_in) { return mp_obj_new_float(lhs_val); } -#endif +#endif // MICROPY_ENABLE_FLOAT @@ -32,7 +32,7 @@ PY_O_BASENAME = \ asmthumb.o \ emitnthumb.o \ emitinlinethumb.o \ - format-float.o \ + formatfloat.o \ parsenumbase.o \ parsenum.o \ runtime.o \ |