kawas <laurent.joi...@gmail.com> writes:

> I've checked with a python repl, the correct value seems to be the one
> using BigDecs
>
>>>> from decimal import *
>>>> Decimal('1.4411518807585587E17') / Decimal(2)
> Decimal('72057594037927935')
>
> I've submitted a bug and commented on it about BigDecimal constructors
> but I may have made a mistake about which value is the correct one...

Yes, you did.  How can a power of two divided by two be *odd* (well,
except for 2/2 = 1, of course)? ;-)

But strangely, clojure is wrong, python is wrong, and ruby is wrong,
too.

--8<---------------cut here---------------start------------->8---
irb(main):012:0> x = BigDecimal.new("1.4411518807585587E17")
=> #<BigDecimal:7fabd400d958,'0.1441151880 7585587E18',18(27)>
irb(main):013:0> x
=> #<BigDecimal:7fabd400d958,'0.1441151880 7585587E18',18(27)>
irb(main):014:0> x / 2
=> #<BigDecimal:7fabd4008368,'0.7205759403 7927935E17',18(81)>
--8<---------------cut here---------------end--------------->8---

So maybe that's a general bigdecimal representation issue?

Bye,
Tassilo

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to