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)很明顯的罪(x)由用戶進入了我的價值沒有得到的條件整點(abs(term).gt。0.000001)這是否意味着計算機不能比這更精確。糾正我,如果我錯了計算的sin(x)使用Fortran語言