Bug 21834 – std.numeric.gcd can't handle negative values

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-16T23:34:32Z
Last change time
2021-04-17T18:04:55Z
Keywords
pull
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2021-04-16T23:34:32Z
void main() { import std.numeric; assert(gcd(-42, 21) == 21); } Worse still, gdc and ldc both hang.
Comment #1 by dlang-bot — 2021-04-17T00:00:06Z
@ibuclaw created dlang/phobos pull request #7974 "fix Issue 21834 - std.numeric.gcd can't handle negative values" fixing this issue: - fix Issue 21834 - std.numeric.gcd can't handle negative values https://github.com/dlang/phobos/pull/7974
Comment #2 by dlang-bot — 2021-04-17T18:04:55Z
dlang/phobos pull request #7974 "fix Issue 21834 - std.numeric.gcd can't handle negative values" was merged into master: - b7a1f34e3c0c2c177e7a22fe515968adc6d54055 by Iain Buclaw: fix Issue 21834 - std.numeric.gcd can't handle negative values https://github.com/dlang/phobos/pull/7974