Skip to content

Commit e042f48

Browse files
fabien.lementecpfalcon
authored andcommitted
py/mpprint: Printing of doubles is now supported (by uPy own routine).
1 parent 3376875 commit e042f48

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

py/mpprint.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -517,19 +517,9 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {
517517
case 'g':
518518
case 'G':
519519
{
520-
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
520+
#if ((MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT) || (MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_DOUBLE))
521521
mp_float_t f = va_arg(args, double);
522522
chrs += mp_print_float(print, f, *fmt, flags, fill, width, prec);
523-
#elif MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_DOUBLE
524-
// Currently mp_print_float uses snprintf, but snprintf
525-
// itself may be implemented in terms of mp_vprintf() for
526-
// some ports. So, for extra caution, this case is handled
527-
// with assert below. Note that currently ports which
528-
// use MICROPY_FLOAT_IMPL_DOUBLE, don't call mp_vprintf()
529-
// with float format specifier at all.
530-
// TODO: resolve this completely
531-
assert(0);
532-
//#error Calling mp_print_float with double not supported from within printf
533523
#else
534524
#error Unknown MICROPY FLOAT IMPL
535525
#endif

0 commit comments

Comments
 (0)