richhickey/clojure-clr

Fix numeric conversions

Closed this issue · 2 comments

I have used three versions of numeric conversion to implement int, long, float, etc.
(a) Convert.ToXXX
(b) switch on TypeCode
(c) if/elseif on Type

Results are mixed. More analysis and benchmarking needed.

In addition, there is a problem with (defn f [x](Math/Sqrt x)) failing on fall to (f 4).

(c) is fastest on numerics.