[Issue 18244] Generic functions in std.math cannot be overloaded

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 16 21:48:42 UTC 2018


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

--- Comment #3 from Răzvan Ștefănescu <rumbu at rumbu.ro> ---
NaN assumes that you want to create a real nan;

The correct signature will be in my opinion:

NaN(F, T)(const T payload)
if (isFloatingPoint!T && isUnsigned!T)

This will allow to create float or double NaNs.


Ref abs: I don't understand exactly why we have abs and fabs. I think that
dropping "fabs" and specializing "abs" for each numeric type is a better
approach.

--


More information about the Digitalmars-d-bugs mailing list