clojure.algo.generic.math-functions/abs did not work on:

clojure.lang.Ratio

clojure.lang.BigInt

java.math.BigDecimal

java.math.BigInteger

I defined defmethods for these classes, plus one for java.lang.Number to preserve the previous functionality for other number classes.

clojure.algo.generic.math-functions/round did not work on

clojure.lang.Ratio

clojure.lang.BigInt

java.math.BigDecimal

java.math.BigInteger

the various java integer classes (why shouldn't round work on integers?)

I defined defmethods to delegate java.Math.round for double and float, to act as the identity on the various integer classes, to delegate to java.math.BigDecimal#round for BigDecimal, and to cast Ratio to either a double or a BigDecimal and round it.

clojure.algo.generic 0.1.2, java 1.8

Konrad Hinsen

Cort Spellman

None

None

Code

Minor

Configure