micropython/tests/float
Dan Ellis 6f4d424f46 py/formatfloat: Use pow(10, e) instead of pos/neg_pow lookup tables.
Rework the conversion of floats to decimal strings so it aligns precisely
with the conversion of strings to floats in parsenum.c.  This is to avoid
rendering 1eX as 9.99999eX-1 etc.  This is achieved by removing the power-
of-10 tables and using pow() to compute the exponent directly, and that's
done efficiently by first estimating the power-of-10 exponent from the
power-of-2 exponent in the floating-point representation.

Code size is reduced by roughly 100 to 200 bytes by this commit.

Signed-off-by: Dan Ellis <dan.ellis@gmail.com>
2022-08-12 23:53:34 +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
cmath_fun.py
cmath_fun_special.py
complex1.py
complex1_intbig.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
complex_dunder.py
complex_reverse_op.py
complex_special_methods.py
float1.py
float2int_doubleprec_intbig.py
float2int_fp30_intbig.py
float2int_intbig.py
float_array.py
float_compare.py
float_divmod.py
float_divmod_relaxed.py
float_dunder.py
float_format.py py/formatfloat: Use pow(10, e) instead of pos/neg_pow lookup tables. 2022-08-12 23:53:34 +10:00
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: Use pow(10, e) instead of pos/neg_pow lookup tables. 2022-08-12 23:53:34 +10:00
float_parse.py
float_parse_doubleprec.py
float_struct.py
inf_nan_arith.py
int_big_float.py
int_divzero.py
int_power.py
lexer.py
list_index.py
math_constants.py
math_constants_extra.py
math_domain.py
math_domain_special.py
math_dunder.py
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 py/formatfloat: Use pow(10, e) instead of pos/neg_pow lookup tables. 2022-08-12 23:53:34 +10:00
string_format_modulo2.py
string_format_modulo2_intbig.py
string_format_modulo3.py
string_format_modulo3.py.exp
true_value.py
types.py