Re: Re : A92: Math functions?
[Prev][Next][Index][Thread]
Re: Re : A92: Math functions?
On Sun, 7 Sep 1997 Hmlacage@aol.com wrote:
> i believe this could be done quite easaly in asm: at least the square root:
> use this suite: Un+1=a/Un
> the limit in +infinity is sqrt(a)
> or: Un+1=Un-Un^2+a
>
Another way (simple, dont need muls or divs) is to subtract the odd
numbers (1, 3, 5, 7, ...) from, say A, until A becoms < 0. Then the number
of subtractions done is an approximative value of sqrt(A).
The problem is that you have to do quite a few loops for A=<big value>,
allso the result contains no decimals.
/slabbe
-------------------------------------------------
| Mattias Slabanja, email: gu95masl@dd.chalmers.se
| URL: slabbe.hemmet.s-hem.chalmers.se
References: