On May 3, 12:38 am, bOR_ <[email protected]> wrote:
> user> (time (dotimes [i 100000] (contribmath-ceil (rand))))                
>
> "Elapsed time: 4500.530303 msecs"                                          
>
> nil                                                                        
>
> user> (time (dotimes [i 100000] (contribgenericmath-ceil (rand))))          
>
> "Elapsed time: 44.707193 msecs"                                            
>
> nil                                                                        
>
> user> (time (dotimes [i 100000] (incanterprocessing-ceil (rand))))          
>
> "Elapsed time: 38.322599 msecs"                                            
>
> nil                                                                        
>
> user> (time (dotimes [i 100000] (inc (int (rand)))))                


That's a terrible ceil method: (inc (int 0)) is 1. The reason it's
fast is that (int x) is a java primitive. It acts like the *floor*
function, making it not useful to you.

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

Reply via email to