With the java.lang.Math
operations all being wrapped, then is it also desirable to do the same with the operations static methods on Double
and Long
?
Some of these functions have simple Clojure(Script) implementations. For instance, Double/isNaN
can be achieved with #(identical? ##NaN %)
but it seems that if the language works with values like ##NaN
, then there should be a built-in way of recognizing it. (I note that some people may not realize that #(= ##NaN %)
will not work).
Each of these functions can also be implemented in ClojureScript. This was demonstrated while reimplementing the clojure.math
namespace for ClojureScript, since many of these methods from Long and Double were needed.