*integer*. The macro will calculate ST(0)^integer / integer!. The Taylor approximation works fine. However, a 7th order Taylor approximation of Sin x is only accurate between -pi and -pi. I have to be able to calculate the sine of any number. The way I tried to shift any number (I will call it Y) into a number between -pi and pi (call it X) is that I use the following equation:

X = pi * (modulo(Y/pi)).

The program does not work though. Any ideas on how I should shift Y so it will be a number between -pi and pi?

Sine PROC

fldpi

fld Z

fprem

fldpi

fmul

fstp X

finit

fld X

mTaylor_Order 1

fld X

mTaylor_Order 5

fadd

fld X

mTaylor_Order 3

fsub

fld X

mTaylor_Order 7

fsub

fstp X

mov eax, X

call WriteHex

call Crlf

ret

Sine ENDP