Automatic arithmetic promotion
Initial work at arithmetic promotion. The PR still requires tests but I'm creating this so that I can get some early feedback, especially on the overflow detection logic.
Requires a repoint.
Resolves https://github.com/jank-lang/jank/issues/359, https://github.com/jank-lang/jank/issues/604.
I'll also aim to add missing Clojure test suite test cases for some of the arithmetic promotion operators.
Interestingly enough it looks like Clojure doesn't seem to support automatic arithmetic promotion from a java.lang.Double to java.math.BigDecimal, although I've yet to receive confirmation on whether that is really the case or not. Anyone with more information or interested in the topic can follow or chime in on the discussion here.
Interestingly enough it looks like Clojure doesn't seem to support automatic arithmetic promotion from a
java.lang.Doubletojava.math.BigDecimal, although I've yet to receive confirmation on whether that is really the case or not. Anyone with more information or interested in the topic can follow or chime in on the discussion here.
Seems like Clojure intentionally chooses to not promote to BigDecimal since the promotion is to account for scale and Decimal is large enough.
CI fails due to: https://github.com/jank-lang/clojure-test-suite/pull/828#discussion_r2559800068.
I've commented the Clojure test suite test cases for these operators, the CI passes now.