[Issue 22983] New: Complex!float.abs / hypot invalid result when argument is small

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 4 09:27:11 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22983

          Issue ID: 22983
           Summary: Complex!float.abs / hypot invalid result when argument
                    is small
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: jp-dev at gmx.com

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);
}

--


More information about the Digitalmars-d-bugs mailing list