[Issue 20205] std.math: Wrong result for abs(int.min)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 4 11:53:51 UTC 2019


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

Ajieskola at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |Ajieskola at gmail.com
         Resolution|FIXED                       |---

--- Comment #8 from Ajieskola at gmail.com ---
The fix had to be reverted, due to confusion and code breakage it would have
caused - see Dlang Bot links.

So the original issue still persists.

I personally think this should be left as-is. It's more a limitation of the
signed integral types than the abs function. Throwing an exception wouldn't be
good -it would break @nogc and nothrow callers and prevents using with
-betterC. A notification in function documentation should suffice.

--


More information about the Digitalmars-d-bugs mailing list