py/formatfloat: Format all whole-number floats exactly.
Formerly, py/formatfloat would print whole numbers inaccurately with nonzero digits beyond the decimal place. This resulted from its strategy of successive scaling of the argument by 0.1 which cannot be exactly represented in floating point. The change in this commit avoids scaling until the value is smaller than 1, so all whole numbers print with zero fractional part. Fixes issue #4212. Signed-off-by: Dan Ellis dan.ellis@gmail.com
This commit is contained in:
@@ -79,6 +79,7 @@ exclude_tests = (
|
||||
"float/float_divmod.py",
|
||||
# requires double precision floating point to work
|
||||
"float/float2int_doubleprec_intbig.py",
|
||||
"float/float_format_ints_doubleprec.py",
|
||||
"float/float_parse_doubleprec.py",
|
||||
# inline asm FP tests (require Cortex-M4)
|
||||
"inlineasm/asmfpaddsub.py",
|
||||
|
||||
Reference in New Issue
Block a user