[issue44954] Bug in float.fromhex

2021-08-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue44954] Bug in float.fromhex

2021-08-20 Thread Pedro Gimeno
Pedro Gimeno added the comment: > @Pedro Thanks again for the report! Just out of curiosity, how did you manage > to find this? I'm writing a C strtod implementation and I was adding corner cases to the unit testing (now published here: https://codeberg.org/pgimeno/ACSL/src/branch/master/te

[issue44954] Bug in float.fromhex

2021-08-20 Thread Mark Dickinson
Mark Dickinson added the comment: All fixed! Closing. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker ___

[issue44954] Bug in float.fromhex

2021-08-20 Thread miss-islington
miss-islington added the comment: New changeset 838b0e975fc2c106508eb27d19a9548533ac1e55 by Miss Islington (bot) in branch '3.10': bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834) https://github.com/python/cpython/commit/838b0e975fc2c106508eb27d19a9548533ac1e55 --

[issue44954] Bug in float.fromhex

2021-08-20 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed in the main branch and in 3.9; 3.10 is very close to release, so the backport PR for 3.10 may have to wait for 3.10.1 (which wouldn't really be a problem, given that this bug has apparently lain unnoticed since Python 2.7). That's Pablo's call, of cour

[issue44954] Bug in float.fromhex

2021-08-20 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset 7ef0673de48958bc3a75af5f152564bd2dffa8dd by Miss Islington (bot) in branch '3.9': bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834) (GH-27855) https://github.com/python/cpython/commit/7ef0673de48958bc3a75af5f152564bd2dffa8dd

[issue44954] Bug in float.fromhex

2021-08-20 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26313 pull_request: https://github.com/python/cpython/pull/27854 ___ Python tracker _

[issue44954] Bug in float.fromhex

2021-08-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +26314 pull_request: https://github.com/python/cpython/pull/27855 ___ Python tracker ___ __

[issue44954] Bug in float.fromhex

2021-08-20 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset 60b93d9e4922eeae25052bc15909d1f4152babde by Mark Dickinson in branch 'main': bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834) https://github.com/python/cpython/commit/60b93d9e4922eeae25052bc15909d1f4152babde --

[issue44954] Bug in float.fromhex

2021-08-19 Thread Mark Dickinson
Change by Mark Dickinson : -- keywords: +patch pull_requests: +26298 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27834 ___ Python tracker ___ _

[issue44954] Bug in float.fromhex

2021-08-19 Thread Mark Dickinson
Mark Dickinson added the comment: The bug is in this line: https://github.com/python/cpython/blob/3db42fc5aca320b0cac1895bc3cb731235ede794/Objects/floatobject.c#L1467 which reads: (half_eps == 8 && (HEX_DIGIT(key_digit+1) & 1) != 0)) In the buggy case, key_digit=0 and the HEX_DI

[issue44954] Bug in float.fromhex

2021-08-19 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the report! I can reproduce the issue, and agree with your analysis. -- assignee: -> mark.dickinson nosy: +mark.dickinson versions: +Python 3.10, Python 3.11 ___ Python tracker

[issue44954] Bug in float.fromhex

2021-08-19 Thread Pedro Gimeno
New submission from Pedro Gimeno : >>> float.fromhex('0x0.8p-1074') 0.0 >>> float.fromhex('0x.8p-1074') 5e-324 One of them is obviously wrong. It's the second one, because: - The smallest denormal is 0x1p-1074 - Therefore, 0x0.8p-1074 is a tie for rounding purposes. - The digit in the last plac