fortran-lang / webpage

New Fortran webpage
https://fortran-lang.org/en
MIT License
47 stars 39 forks source link

Fortran Best Practices: Floating Point Numbers comparison #203

Open band-a-prend opened 1 year ago

band-a-prend commented 1 year ago

The Floating Point Number section of Fortran Best Practices could be extended with 2 subsections:

  1. comparison of two real numbers;
  2. undesirability of using real as iterator within do loops (it was deprecated in Fortran95 standard).

The motivation.
It's common problem for all programming languages when beginner programmer tries to compare fooating points numbers especially using if statement. It would be usefull to demonstrate more accurate approaches (with use of intrinsic procedures?) of comparing numbers to avoid accuracy and computational issues.

The second problem comes from first one and could results in computational issues.

PANKAJ11111111 commented 9 months ago

Please give chance i fix this problem