www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17705] New: std.math.isFinite cannot run at compile-time

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

          Issue ID: 17705
           Summary: std.math.isFinite cannot run at compile-time
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: lt.infiltrator gmail.com

----
import std.math : isFinite;
enum test = isFinite(15.0);
----

From what I understand from ketmar, the issue is that the CTFE allows casting
of floating types only to the same size, but isFinite casts it to ushort. This can be solved for float and double by using uint and ulong, respectively; but I do not know how to make it work real, unless we allow casting to a struct/array. --
Jul 30 2017