real BigDecimal type (bigdec, M literals)
bigdec / 1.5M / 0.0M silently produced doubles. Add a jbigdec value type
{unscaled, scale} over Chez exact integers (host/chez/bigdec.ss): value =
unscaled * 10^-scale. An M-suffix literal reads to a :bigdec form that the back
end lowers to jolt-bigdec-from-string (same IR-leaf path as #inst/#uuid); bigdec
coerces a number/string. Equality is by value (1.0M = 1.00M true, 3M = 3 false),
str drops the M and pr keeps it, class is java.math.BigDecimal, decimal? is true.
Arithmetic contagion isn't modelled (out of scope). The old corpus cases passed
spuriously as doubles; they now exercise a genuine BigDecimal.
This commit is contained in:
parent
7db5fabc8d
commit
ab96650fbb
10 changed files with 288 additions and 191 deletions
|
|
@ -347,3 +347,8 @@
|
|||
;; thread macros, def-var!'d into clojure.core.async. After concurrency.ss (reuses
|
||||
;; ms->duration) and the collection/seq layer.
|
||||
(load "host/chez/async.ss")
|
||||
|
||||
;; BigDecimal (jolt-i2jm): the jbigdec value type + bigdec/decimal?/class/equality/
|
||||
;; printing. Loads LAST so its set!-wraps of jolt-class/jolt=2/the printers sit
|
||||
;; outermost over every earlier extension.
|
||||
(load "host/chez/bigdec.ss")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue