summaryrefslogtreecommitdiffstatshomepage
path: root/py/formatfloat.c
diff options
context:
space:
mode:
authorDan Ellis <dan.ellis@gmail.com>2022-07-28 23:21:00 -0400
committerDamien George <damien@micropython.org>2022-08-12 23:44:11 +1000
commit6cd2e4191803e95580bdfc57c06ea818454a25d1 (patch)
tree20101bd9787df048d364b51a39e48baba99ea684 /py/formatfloat.c
parent69719927f1752b2d6333708c5b60067fe3b7965d (diff)
downloadmicropython-6cd2e4191803e95580bdfc57c06ea818454a25d1.tar.gz
micropython-6cd2e4191803e95580bdfc57c06ea818454a25d1.zip
py/parsenum: Ensure that trailing zeros lead to identical results.
Prior to this commit, parsenum would calculate "1e-20" as 1.0*pow(10, -20), and "1.000e-20" as 1000.0*pow(10, -23); in certain cases, this could make seemingly-identical values compare as not equal. This commit watches for trailing zeros as a special case, and ignores them when appropriate, so "1.000e-20" is also calculated as 1.0*pow(10, -20). Fixes issue #5831.
Diffstat (limited to 'py/formatfloat.c')
0 files changed, 0 insertions, 0 deletions