> < ^ Date: Thu, 26 Sep 2002 23:17:35 -0400 (EDT)
> < ^ From: Sven Reichard <reichard@math.udel.edu >
> < ^ Subject: Re: Ceiling of a square root

Dear GAP-Forum

On Fri, 27 Sep 2002, Neilen wrote:

Hi all.

I'm looking to get the integer ceiling of a square root. RootInt gives
one the floor (ie RootInt(2) = RootInt(3) = 1, RootInt(5) = 2), while I
would want them to be respectively 2,2 and 3.

Thanks
Neilen

RootIntCeiling := function(n)
  if n = 0 then
    return 0;
  fi;
  return 1 + RootInt(n-1);
end;

Sven Reichard.

--
Sven Reichard
Dept. of Math. Sci.
University of Delaware
reichard@math.udel.edu

Miles-Receive-Header: reply


> < [top]