-
- Downloads
py/formatfloat: Fix number of digits and exponent sign when rounding.
This patch fixes 2 things when printing a floating-point number that requires rounding up of the mantissa: - retain the correct precision; eg 0.99 becomes 1.0, not 1.00 - if the exponent goes from -1 to 0 then render it as +0, not -0
Showing
- py/formatfloat.c 6 additions, 1 deletionpy/formatfloat.c
- tests/float/string_format_modulo.py 3 additions, 0 deletionstests/float/string_format_modulo.py
- tests/float/string_format_modulo3.py 1 addition, 2 deletionstests/float/string_format_modulo3.py
- tests/float/string_format_modulo3.py.exp 1 addition, 2 deletionstests/float/string_format_modulo3.py.exp
Please register or sign in to comment