Excellent - thanks for clarifying this!

- Korny

On Sun, Feb 8, 2009 at 12:27 AM, Rich Hickey <richhic...@gmail.com> wrote:
>
>
> On Feb 7, 2009, at 3:43 AM, Korny Sietsma wrote:
>
>>
>> Ah - I didn't realise that.  I was trying to avoid the overhead, as I
>> understood it, of both converting the parameters to Float/Double
>> objects, and then of checking for overflow.
>>
>> So '*' and '+' don't do overflow checking - do they need to convert
>> primitives to/from objects?  Specifically, when I call:
>> (loop [x (double x) y (double y)]
>>  ... do maths to x and y
>>  (recur x y)
>> )
>>
>> Is it going to have to convert x and y between 'double' and 'Double'
>> at all, or will it just work with primitive types???
>>
>
> This will declare the locals x and y to be primitive doubles,
> converting once on entry, and all math ops involving them and other
> primitives will be primitive. Also, if you accidentally try to recur
> with a boxed value you will get an error.
>
> Rich
>
>
> >
>



-- 
Kornelis Sietsma  korny at my surname dot com
kornys on gmail, twitter, facebook, etc.
"Every jumbled pile of person has a thinking part
that wonders what the part that isn't thinking
isn't thinking of"

--~--~---------~--~----~------------~-------~--~----~
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
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