try this
Code: Select all
@echo off
setlocal enableDelayedExpansion
(Set \n=^^^
%= \n escaped linefeed for macro definition. Do not modify =%
%= Do not modify =%)
set sin=for %%# in (1 2) do if %%#==2 ( %\n%
for /f "tokens=1 delims=, " %%1 in ("^!args^!") do ( %\n%
set /a "$result=($a=((%%1*31416/180)%%62832) + (((%%1*31416/180)%%62832)>>31&62832) , $b=($a-15708^^$a-47124)>>31 ,$a=(-$a&$b)+($a&~$b)+(31416&$b)+(-62832&(47123-$a>>31)), $a-$a*$a/1875*$a/320000+$a*$a/1875*$a/15625*$a/16000*$a/2560000-$a*$a/1875*$a/15360*$a/15625*$a/15625*$a/16000*$a/44800000 )" %\n%
)) else set args=
%sin% 45
echo sin(45)=0.%$result%
pause