integer n
real term , sum , deg
write(*,*) 'Enter Degree'
read(*,*) deg
deg = deg * 3.14 /180
n = 3
term = deg
sum = 0
2 if ( abs(term) .gt. 0.000001) then !<<<<<<<<<<< THIS CONDITION
goto 1
else
goto 3
endif
1 sum = sum + term
write( *,*) 'Your', n - 2, ' Term is ' , term
term = term *(( deg ** 2)/ (n *( n - 1))) * (-1)
n = n + 2
goto 2
3 write(*,*) ' YOur final sum ' , sum
pause
end
我发现这个程序用于计算 Sin(x) 很明显 Sin(x) 的值是由用户输入的,我没有得到条件的全部点( abs(term) .gt. 0.000001)这是否意味着计算机不能比这更精确。如果我错了,请纠正我