Hi(adsbygoogle = window.adsbygoogle || []).push({});

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

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Small numbers in Fortran 95

Loading...

Similar Threads - Small numbers Fortran | Date |
---|---|

Python Adding very small values to very large numbers | Jun 9, 2016 |

I can't find a small bug in this Fortran code | May 3, 2015 |

Multiplying small numbers and getting Inf | Nov 11, 2013 |

Why insertion sort works better than quick-sort for small data? | Jun 19, 2013 |

Why Doesn't Fortran Recognize Small Numbers? | Apr 9, 2009 |

**Physics Forums - The Fusion of Science and Community**