mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
py/formatfloat: Fix rounding of %f format with edge-case FP values.
Prior to this patch the %f formatting of some FP values could be off by up to 1, eg '%.0f' % 123 would return "122" (unix x64). Depending on the FP precision (single vs double) certain numbers would format correctly, but others wolud not. This patch should fix all cases of rounding for %f.
This commit is contained in:
@@ -56,7 +56,7 @@ Warning: test
|
||||
+1e+00
|
||||
+1e+00
|
||||
# binary
|
||||
122
|
||||
123
|
||||
456
|
||||
# VM
|
||||
2 1
|
||||
|
||||
Reference in New Issue
Block a user