- #1
issacnewton
- 1,026
- 36
Hi
I am doing a program using gfortran compiler. I feed angle theta in degrees to the program. Program is supposed to calculate the value of tan(theta) using values of sine and cosine of theta. the program should give warning of division-by-zero if magnitude of cosine theta is less than 10-20. I have attached the code in jpg file...
When I feed theta=90, the cosine value takes values like 4.37E-8 , so tan theta is always calculated...how can we rectify this ?
thanks
I am doing a program using gfortran compiler. I feed angle theta in degrees to the program. Program is supposed to calculate the value of tan(theta) using values of sine and cosine of theta. the program should give warning of division-by-zero if magnitude of cosine theta is less than 10-20. I have attached the code in jpg file...
When I feed theta=90, the cosine value takes values like 4.37E-8 , so tan theta is always calculated...how can we rectify this ?
thanks