[Issue 21834] New: std.numeric.gcd can't handle negative values

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 16 23:34:32 UTC 2021


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

          Issue ID: 21834
           Summary: std.numeric.gcd can't handle negative values
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

void main()
{
    import std.numeric;
    assert(gcd(-42, 21) == 21);
}

Worse still, gdc and ldc both hang.

--


More information about the Digitalmars-d-bugs mailing list