[Issue 8666] std.math.abs(int.min) returns int.min

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 16 03:40:34 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8666


Andrei Alexandrescu <andrei at metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei at metalanguage.com


--- Comment #1 from Andrei Alexandrescu <andrei at metalanguage.com> 2012-09-16 03:41:26 PDT ---
This is a known anomaly. I assume you are proposing that returning long is the
right way to go about it, but it really isn't.

One possibility would be to return uint for int and smaller, and ulong for
long. That would be a principled way to go about it, but would break existing
code in rather subtle ways.

We could add uabs to return an unsigned type.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list