This behavior makes no sense to me:
user=> (type 1)
java.lang.Long
user=> (type (cast Long 1))
java.lang.Long
user=> (type 1)
java.lang.Long
user=&g
BigDecimal does not have a constructor for Long,
BigDecimal(BigInteger val)
core> (BigDecimal. (BigInteger/ONE))
1M
BigDecimal(BigInteger unscaledVal, int scale)
core> (BigDecimal. BigInteger/ONE 1)
0.1M
BigDecimal(double val)
core> (BigDecimal. (double 1))
1M
core> (BigDecimal. (float 1))
1M
(BigDecimal. Double/MIN_VALUE)
BigDecimal(String val)
core> (BigDecimal. "1")
1M
It's unclear which of these (Long. 1) matches. the clojure.core.bigdec function works on this input by passing it's input to BigDec/valueOf to create the BigDecimal
core> (bigdec (Long. 1))
1M
uses this call:
(BigDecimal/valueOf (long x))