abs and minimum values

Imperatorn johan_forsberg_86 at hotmail.com
Fri Oct 29 09:45:15 UTC 2021


On Friday, 29 October 2021 at 09:35:09 UTC, Dom DiSc wrote:
> On Friday, 29 October 2021 at 08:33:07 UTC, Imperatorn wrote:
>> Imo abs should never be able to return a negative value
>
> Yes, but phobos defines it to return a signed type, so 
> theoretical it can return negative values. And they won't 
> change that.
>
> I really think it should return an unsigned type, but that's a 
> "breaking change".
> Bullshit policy!

Eeh... Why does it return unsigned in phobos? Is it just to stay 
compatible with C? 🤔


More information about the Digitalmars-d-learn mailing list