circuitpython/tests/float
Dan Ellis 9b5e00fcc5 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-08-09 13:43:47 -04:00
..
array_construct.py Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
builtin_float_abs.py codeformat 2021-04-19 22:22:44 -07:00
builtin_float_hash.py codeformat 2021-04-19 22:22:44 -07:00
builtin_float_minmax.py codeformat 2021-04-19 22:22:44 -07:00
builtin_float_pow.py codeformat 2021-04-19 22:22:44 -07:00
builtin_float_round.py codeformat 2021-04-19 22:22:44 -07:00
builtin_float_round_intbig.py codeformat 2021-04-19 22:22:44 -07:00
bytearray_construct_endian.py tests/float: Make bytes/bytearray construct tests work with obj repr C. 2021-06-18 14:16:07 +10:00
bytes_construct_endian.py tests/float: Make bytes/bytearray construct tests work with obj repr C. 2021-06-18 14:16:07 +10:00
cmath_fun.py codeformat 2021-04-19 22:22:44 -07:00
cmath_fun_special.py codeformat 2021-04-19 22:22:44 -07:00
complex1.py update to py tests and scripts due to black 22.1.0 2022-01-29 17:14:01 -05:00
complex1_intbig.py codeformat 2021-04-19 22:22:44 -07:00
complex_reverse_op.py tests: Split out complex reverse-op tests to separate test file. 2020-08-29 14:12:20 +10:00
complex_special_methods.py tests: Split out complex reverse-op tests to separate test file. 2020-08-29 14:12:20 +10:00
float1.py update to py tests and scripts due to black 22.1.0 2022-01-29 17:14:01 -05:00
float2int_doubleprec_intbig.py update to py tests and scripts due to black 22.1.0 2022-01-29 17:14:01 -05:00
float2int_fp30_intbig.py update to py tests and scripts due to black 22.1.0 2022-01-29 17:14:01 -05:00
float2int_intbig.py update to py tests and scripts due to black 22.1.0 2022-01-29 17:14:01 -05:00
float_array.py tests: Make float and framebuf tests skip or run on big-endian archs. 2021-05-26 16:33:18 +10:00
float_compare.py codeformat 2021-04-19 22:22:44 -07:00
float_divmod.py codeformat 2021-04-19 22:22:44 -07:00
float_divmod_relaxed.py codeformat 2021-04-19 22:22:44 -07:00
float_format.py codeformat 2021-04-19 22:22:44 -07:00
float_format_ftoe.py py/formatfloat: Format all whole-number floats exactly. 2022-08-09 13:43:47 -04:00
float_format_ftoe.py.exp py/formatfloat: Format all whole-number floats exactly. 2022-08-09 13:43:47 -04:00
float_format_ints.py py/formatfloat: Format all whole-number floats exactly. 2022-08-09 13:43:47 -04:00
float_format_ints_doubleprec.py py/formatfloat: Format all whole-number floats exactly. 2022-08-09 13:43:47 -04:00
float_parse.py codeformat 2021-04-19 22:22:44 -07:00
float_parse_doubleprec.py codeformat 2021-04-19 22:22:44 -07:00
float_struct.py codeformat 2021-04-19 22:22:44 -07:00
inf_nan_arith.py update to py tests and scripts due to black 22.1.0 2022-01-29 17:14:01 -05:00
int_big_float.py update to py tests and scripts due to black 22.1.0 2022-01-29 17:14:01 -05:00
int_divzero.py update to py tests and scripts due to black 22.1.0 2022-01-29 17:14:01 -05:00
int_power.py update to py tests and scripts due to black 22.1.0 2022-01-29 17:14:01 -05:00
lexer.py tests/float: Add new lexer test to test parsing of float without prefix. 2020-03-30 13:23:05 +11:00
list_index.py tests: Rename test scripts, changing - to _ for consistency. 2014-07-05 06:14:29 +01:00
math_domain.py codeformat 2021-04-19 22:22:44 -07:00
math_domain_special.py codeformat 2021-04-19 22:22:44 -07:00
math_factorial_intbig.py codeformat 2021-04-19 22:22:44 -07:00
math_fun.py codeformat 2021-04-19 22:22:44 -07:00
math_fun_bool.py codeformat 2021-04-19 22:22:44 -07:00
math_fun_int.py codeformat 2021-04-19 22:22:44 -07:00
math_fun_intbig.py codeformat 2021-04-19 22:22:44 -07:00
math_fun_special.py codeformat 2021-04-19 22:22:44 -07:00
math_isclose.py Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
math_isclose.py.exp Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
python36.py codeformat 2021-04-19 22:22:44 -07:00
python36.py.exp py/lexer: Add support for underscores in numeric literals. 2018-06-12 12:17:43 +10:00
string_format.py codeformat 2021-04-19 22:22:44 -07:00
string_format2.py codeformat 2021-04-19 22:22:44 -07:00
string_format_fp30.py codeformat 2021-04-19 22:22:44 -07:00
string_format_modulo.py codeformat 2021-04-19 22:22:44 -07:00
string_format_modulo2.py codeformat 2021-04-19 22:22:44 -07:00
string_format_modulo2_intbig.py codeformat 2021-04-19 22:22:44 -07:00
string_format_modulo3.py codeformat 2021-04-19 22:22:44 -07:00
string_format_modulo3.py.exp py/formatfloat: Fix number of digits and exponent sign when rounding. 2017-06-13 13:36:56 +10:00
true_value.py codeformat 2021-04-19 22:22:44 -07:00
types.py tests: Split out those tests requiring float and import. 2014-04-17 16:21:43 +01:00