Re: [Q] default decimal of Clojure is IEEE double, not BigDecimal

2015-12-23 Thread burrownn
Hmm... Okay. Actually, I think I was confused with auto promotion of integer types. I was quite impressed that Clojure automatically add 'N' when I type big integer like '69487463928746987124659827635827'. However, I was suprised when I type '6.9487463928746987124659827635827', because the resul

Re: [Q] default decimal of Clojure is IEEE double, not BigDecimal

2015-12-22 Thread Mikera
I personally think the current approach is right. Most people don't need arbitrary precision decimals, so it makes sense to have the fastest implementation used as the default. This also follows the "principle of least surprise" for people who are coming from other languages. If someone really

Re: [Q] default decimal of Clojure is IEEE double, not BigDecimal

2015-12-22 Thread Gary Fredericks
Am I missing something? I realize doubles are generally faster because of hardware implementations &c, but that seems orthogonal from the question of syntax. I've several times thought idealistically that it could be better to have the syntaxes switched (to reduce the amount of accidental floati

[Q] default decimal of Clojure is IEEE double, not BigDecimal

2015-12-22 Thread Alex Miller
It's done this way for performance. -- 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

[Q] default decimal of Clojure is IEEE double, not BigDecimal

2015-12-22 Thread burrownn
I learned that Clojure reader interprets decimal literal with suffix 'M', like 1.23M, as BigDecimal. And I also know that decimal numbers with no 'M' become Java double. But I think it would be better that normal decimal number is BigDecimal, and host-dependent decimal has suffix, like 1.23H. So