Re: TI-M: Even Square


[Prev][Next][Index][Thread]

Re: TI-M: Even Square




I just notice you algorithm
> evensq(n)
> Func
> return (ceiling(sqrt(n) / 2) * 2) ^ 2
> EndFunc
 It works faster then a loop, I believe.

-int(-n) does the same as ceiling(n)

I tried it on my 86 as just an input
(-int (-sqr(n)/2)*2)^2            sqr() squareroot symbol
                                             n as inputed value
                                             re-entering using ENTRY
                                             i.e (2nd ENTER)

----- Original Message -----
From: <JasonScho@aol.com>
To: <ti-math@lists.ticalc.org>
Sent: Tuesday, May 23, 2000 8:26 AM
Subject: Re: TI-M: Even Square


>
> Or without even the If-Then statement...
> (I assume ceiling means the smallest integer <= the argument.  I don't
have a
> 92)
>
> evensq(n)
> Func
> return (ceiling(sqrt(n) / 2) * 2) ^ 2
> EndFunc
>
> If there's a simpler way to enter this in, I don't know it, because I
don't
> have a 92.  This can be adapted to any other graphing calculator (using
int
> instead of ceiling).
>
>




References: