40 minutes ago, Carl Eastlund wrote:
> That's an overly specific solution.  I believe the more general rounding
> function taught in grade-school math would be:
> 
> (define (my-round n)
>   (floor (+ n 1/2)))

If you want 0.5 to round down to 0, then

  (define (my-round n) (ceiling (- n 1/2)))

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to