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) 이것은 컴퓨터가 이보다 더 정확하게 할 수 없다는 뜻입니까? 내가 틀렸다면 나를 바로 잡으시오.Fortran을 사용하여 Sin (x) 계산하기