Bug 22983 – Complex!float.abs / hypot invalid result when argument is small

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-04-04T09:27:11Z
Last change time
2024-12-01T16:40:00Z
Assigned to
No Owner
Creator
Cimalando
Moved to GitHub: phobos#10491 →

Comments

Comment #0 by jp-dev — 2022-04-04T09:27:11Z
This is a bad computation reproduced in the example below. Expected -5.016558e-20, got 6.2102e+07. DMD 2.099.0, Linux x86_64 import std.complex; import std.stdio; void main() { Complex!float x = -5.016558e-20; writeln(x.abs); }
Comment #1 by aliloko — 2022-04-04T19:59:13Z
*** Issue 22984 has been marked as a duplicate of this issue. ***
Comment #2 by jp-dev — 2022-04-06T14:28:57Z
Note: it appears broken by the commit "Support more float types in hypot" https://github.com/dlang/phobos/commit/543a3d0cd626d3399258b941bd6f5d8c3fc79cbb
Comment #3 by robert.schadek — 2024-12-01T16:40:00Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10491 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB