Fixed (rev 1190)
tristan a écrit :
> Thanks for the explanation Christophe.
> I really need to try use (for) more often. I seem to forget about it
> all the time.
>
> On Dec 27, 10:42 pm, Christophe Grand wrote:
>
>> tristan a écrit :
>>
>>
>>> Hi All,
>>>
>>> I've been trying to
Rich Hickey a écrit :
> The right thing I think is to represent as Integer and Long whenever
> possible, and do overflow checking (as is done in the static
> add(long,long) etc) rather than pre-op upconversion to next size. This
> would require the addition of a LongOps etc.
>
I see.
> I'
On Dec 28, 2008, at 5:27 AM, Christophe Grand wrote:
>
> Mark Engelberg a écrit :
>> So one thing I don't get is why would tristan's pow code sometimes
>> generate a BigInteger, and sometimes a Long for the same resulting
>> number?
>>
> Good question.
>
> (pow 2 32); returns 4294967296 (BigInte
Mark Engelberg a écrit :
> So one thing I don't get is why would tristan's pow code sometimes
> generate a BigInteger, and sometimes a Long for the same resulting
> number?
>
Good question.
(pow 2 32); returns 4294967296 (BigInteger)
(pow 4 16); returns 4294967296 (Long)
(pow 16 8); returns 42
Thanks for the explanation Christophe.
I really need to try use (for) more often. I seem to forget about it
all the time.
On Dec 27, 10:42 pm, Christophe Grand wrote:
> tristan a écrit :
>
> > Hi All,
>
> > I've been trying to learn clojure lately by solving the project euler
> > problems with i
So one thing I don't get is why would tristan's pow code sometimes
generate a BigInteger, and sometimes a Long for the same resulting
number?
But if this is really the problem, it seems like before hashing a
number, Clojure should apply some sort of consistent type conversion
rule to make sure th
tristan a écrit :
> Hi All,
>
> I've been trying to learn clojure lately by solving the project euler
> problems with it, and I think the distinct function is broken (or it
> doesn't quite work as I assume it would).
>
> here is the code i'm running
>
>
> (defn pow [nbr pwr]
> (if (< pwr 2)
>
Hi All,
I've been trying to learn clojure lately by solving the project euler
problems with it, and I think the distinct function is broken (or it
doesn't quite work as I assume it would).
here is the code i'm running
(defn pow [nbr pwr]
(if (< pwr 2)
nbr
(* nbr (pow nbr (dec pwr