diff --git a/SMILEBASIC/builtinfunctions.d b/SMILEBASIC/builtinfunctions.d index b51addf..b1e9307 100644 --- a/SMILEBASIC/builtinfunctions.d +++ b/SMILEBASIC/builtinfunctions.d @@ -203,6 +203,24 @@ class BuiltinFunction { return tanh(arg1); } + enum Classify + { + NORMAL = 0, + INFINITY = 1, + NAN = 2, + } + static pure nothrow int CLASSIFY(double arg) + { + if (arg.isNaN) + { + return Classify.NAN; + } + if (arg.isInfinity) + { + return Classify.INFINITY; + } + return Classify.NORMAL; + } static pure nothrow double RAD(double arg1) { return arg1 * std.math.PI / 180;