Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
e042f485
Commit
e042f485
authored
Nov 30, 2015
by
fabien.lementec
Committed by
Paul Sokolovsky
Dec 02, 2015
Browse files
py/mpprint: Printing of doubles is now supported (by uPy own routine).
parent
3376875b
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/mpprint.c
View file @
e042f485
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment