summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorfabien.lementec <fabien.lementec@gmail.com>2015-11-30 16:00:41 +0100
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-12-02 14:21:36 +0200
commite042f485ed9fc71b0a8ceca1dca89fe29d2179df (patch)
treedc73be475a7d572ef54930d8c4ecb215b6b02c9d
parent3376875bc8bc7d6854823dcb2c4b763d7c582a99 (diff)
downloadmicropython-e042f485ed9fc71b0a8ceca1dca89fe29d2179df.tar.gz
micropython-e042f485ed9fc71b0a8ceca1dca89fe29d2179df.zip
py/mpprint: Printing of doubles is now supported (by uPy own routine).
-rw-r--r--py/mpprint.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/py/mpprint.c b/py/mpprint.c
index 54b0e47d15..f751e9a5e6 100644
--- a/py/mpprint.c
+++ b/py/mpprint.c
@@ -517,19 +517,9 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {
case 'g':
case 'G':
{
-#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
+#if ((MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT) || (MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_DOUBLE))
mp_float_t f = va_arg(args, double);
chrs += mp_print_float(print, f, *fmt, flags, fill, width, prec);
-#elif MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_DOUBLE
- // Currently mp_print_float uses snprintf, but snprintf
- // itself may be implemented in terms of mp_vprintf() for
- // some ports. So, for extra caution, this case is handled
- // with assert below. Note that currently ports which
- // use MICROPY_FLOAT_IMPL_DOUBLE, don't call mp_vprintf()
- // with float format specifier at all.
- // TODO: resolve this completely
- assert(0);
-//#error Calling mp_print_float with double not supported from within printf
#else
#error Unknown MICROPY FLOAT IMPL
#endif