micropython/tests/float
Dan Ellis f9cbe6bc47 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
2022-07-26 22:23:47 +10:00
..
array_construct.py
builtin_float_abs.py
builtin_float_hash.py
builtin_float_minmax.py
builtin_float_pow.py
builtin_float_round.py
builtin_float_round_intbig.py
bytearray_construct_endian.py
bytes_construct_endian.py
cmath_dunder.py py/obj: Make mp_obj_get_complex_maybe call mp_obj_get_float_maybe first. 2022-07-25 16:11:26 +10:00
cmath_fun.py
cmath_fun_special.py
complex1.py py/parsenum: Fix parsing of complex "j" and also "nanj", "infj". 2022-06-23 11:46:47 +10:00
complex1_intbig.py
complex_dunder.py py/obj: Make mp_obj_get_complex_maybe call mp_obj_get_float_maybe first. 2022-07-25 16:11:26 +10:00
complex_reverse_op.py
complex_special_methods.py
float1.py all: Update Python formatting to latest Black version 22.1.0. 2022-02-02 16:49:55 +11:00
float2int_doubleprec_intbig.py all: Update Python formatting to latest Black version 22.1.0. 2022-02-02 16:49:55 +11:00
float2int_fp30_intbig.py all: Update Python formatting to latest Black version 22.1.0. 2022-02-02 16:49:55 +11:00
float2int_intbig.py all: Update Python formatting to latest Black version 22.1.0. 2022-02-02 16:49:55 +11:00
float_array.py
float_compare.py
float_divmod.py
float_divmod_relaxed.py
float_dunder.py py/obj: Add support for __float__ and __complex__ functions. 2022-07-25 14:23:34 +10:00
float_format.py
float_format_ftoe.py py/formatfloat: Format all whole-number floats exactly. 2022-07-26 22:23:47 +10:00
float_format_ftoe.py.exp py/formatfloat: Format all whole-number floats exactly. 2022-07-26 22:23:47 +10:00
float_format_ints.py py/formatfloat: Format all whole-number floats exactly. 2022-07-26 22:23:47 +10:00
float_format_ints_doubleprec.py py/formatfloat: Format all whole-number floats exactly. 2022-07-26 22:23:47 +10:00
float_parse.py
float_parse_doubleprec.py
float_struct.py
inf_nan_arith.py all: Update Python formatting to latest Black version 22.1.0. 2022-02-02 16:49:55 +11:00
int_big_float.py all: Update Python formatting to latest Black version 22.1.0. 2022-02-02 16:49:55 +11:00
int_divzero.py all: Update Python formatting to latest Black version 22.1.0. 2022-02-02 16:49:55 +11:00
int_power.py all: Update Python formatting to latest Black version 22.1.0. 2022-02-02 16:49:55 +11:00
lexer.py
list_index.py
math_constants.py
math_constants_extra.py
math_domain.py
math_domain_special.py
math_dunder.py py/obj: Make mp_obj_get_complex_maybe call mp_obj_get_float_maybe first. 2022-07-25 16:11:26 +10:00
math_factorial_intbig.py
math_fun.py
math_fun_bool.py
math_fun_int.py
math_fun_intbig.py
math_fun_special.py
math_isclose.py
math_isclose.py.exp
python36.py
python36.py.exp
string_format.py
string_format2.py
string_format_fp30.py
string_format_modulo.py
string_format_modulo2.py
string_format_modulo2_intbig.py
string_format_modulo3.py
string_format_modulo3.py.exp
true_value.py
types.py