On page http://clojure.org/data_structures#toc2 there is written: Any
numeric operation involving Doubles yields a Double.
Hope this helps,
Lauri
On Sun, Jan 17, 2010 at 12:13 AM, Jevgeni Holodkov
jevgeni.holod...@gmail.com wrote:
Currently, if the result of the multiplication is too small,
Hi Ben, thanks for the answer. Yes, I understand the problems with
representing float-point numbers using iee7654 and now I understand
that returing BigDecimal would not solve the actual problem. However,
we don't talk about 0.3(3) in my example, which is non-terminating
decimal. Entered 0.1
On 17.01.2010, at 23:13, Jevgeni Holodkov wrote:
decimal. Entered 0.1 is actually a very precise number and the fact
that it gets imprecise somewhere internally should now affect, IMHO,
the result of multiplying two very precise numbers. What's the point
There is no such thing as a precise or
Something like replacing the 1.1 with 1.1M or 11/10 before evaluating
the code?
I don't think so. The very first step of Clojure's expression
processing system, the reader, already interprets 1.1 as a floating-
point constant. You would need your own reader to give a different
meaning to
Currently, if the result of the multiplication is too small, then the
type will be double, despite the fact that one of the parameter was
BigDecimal:
Clojure 1.1.0
user= (* 100M 1.1)
110.01
user= (class (* 100M 1.1))
java.lang.Double
Such thing are really hard to find and this can be
On Sat, Jan 16, 2010 at 23:13, Jevgeni Holodkov
jevgeni.holod...@gmail.com wrote:
Currently, if the result of the multiplication is too small, then the
type will be double, despite the fact that one of the parameter was
BigDecimal:
Clojure 1.1.0
user= (* 100M 1.1)
110.01
user=