[racket] Why is this slow?

From: Tim Brown (tim.brown at timb.net)
Date: Thu Apr 25 05:53:04 EDT 2013

On 24 Apr 2013 10:42, "Shannon Severance" <srs at s53.me> wrote:
>       (define sqrt-n (inexact->exact (ceiling(sqrt n))))

Racket has integer-sqrt, which saves you defining sqrt-n every time.
Also worth noting is sqr, which covers the occasions you want (* x x) or
(expt x 2)

Customer testimonial:
> I have used integer-sqrt in lots of Project Euler problems. It has never
let me down!
>  - Tim, Epsom

--
sent from my phone
consider yourself lucky if you get
all the right letters in the right order
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130425/26c2d889/attachment.html>

Posted on the users mailing list.