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


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