Re: LF: ASM Question...Help please...


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

Re: LF: ASM Question...Help please...




>	Yes, there is a formula for finding these functions.  Suppose x is
>an angle given in radians (180 degrees = \pi radians).  Then:
>
>If n! = n * (n-1) * (n-2) * . . . * 3 * 2 * 1 then we have:
>
>cos x = 1 - x^2/2! + x^4/4! - x^6/6! + . . .
>sin x = x - x^3/3! + x^5/5! - x^7/7! + . . .
>tan x = (sin x)/(cos x)
>(there is also one for arctan, but it is a bit hairy...)

Those are the taylor polynomials for those functions...

>
>	Note:  These require skill at decimal arithmetic, something the
>68k processor is not good at.  Also, these series are INFINITELY long.
>Decent accuracy takes some time, especially for large values of x.  This
>is the reason why, when programming for speed, lookup tables are used.
>True, a lookup table will be missing some values.  Simply rounding to the
>nearest value usually suffices, however.
>
>

So are you saying calculators normally use lookup tables?

-Mark-