[Issue 18559] std.math.* should stop using `real` overloads by default

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 5 22:44:34 UTC 2018


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

kinke at gmx.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke at gmx.net

--- Comment #1 from kinke at gmx.net ---
(In reply to hsteoh from comment #0)
> Let 80-bit be an option if the user
> wants to, sure.  But can we please, pretty please, change the default type
> in std.math.* to double instead of real.

Performing the operation in the precision of the operands is what I'd expect.
So having to cast explicitly to real if my data is stored as float/double and
max precision is needed.

Some math functions are still only implemented for `real`, but they support
reals in double/x87/quadruple precision for the different architectures, i.e.,
support for 64-bit doubles (proper constants, limits etc.) is already there.
E.g., std.math.atan(real) could be generalized to a template
(float/double/real) after adding single-precision support (from Cephes
probably).

--


More information about the Digitalmars-d-bugs mailing list