大家好,
希望core.typed是合适类别,并没有"core"可以选择
Clojure 1.10.1
(with-precision 4 1.23456) ;; 1.23456
(with-precision 4 1.23456M) ;; 1.23456M
(with-precision 4 (BigDecimal. 1.23456)) ;; 1.2345600000000001017497197608463466167449951171875M
(with-precision 4 (* 1 (BigDecimal. 1.23456))) ;; 1.235M
(with-precision 4 (+ 0 (BigDecimal. 1.23456))) ;; 1.235M
只有当数字是*或+的结果供应时,似乎才能像预期那样工作
敬礼,
Daniel