www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18258] New: std.math.NaN redesign

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

          Issue ID: 18258
           Summary: std.math.NaN redesign
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: rumbu rumbu.ro

The current signature allows creation only for real NaNs with payloads. It's
impossible to create float or double NaNs with a payload.

Proposal:

Redesign NaN to allow creation of other floating point types:
T NaN(T = real, U)(const U payload) if (isFloatingPoint!T && isUnsigned!U)

--
Jan 17 2018