054. Consider using a tolerance to compare floats#
topic: Basics
Note
This tip is a draft1.
If the arrays are INTEGER or CHARACTER, then the comparison can be exact. For REAL or COMPLEX arrays, you should consider using a suitably small tolerance when comparing values. This and the previous tip are from urbanjost.
If the arrays are INTEGER or CHARACTER, then the comparison can be exact. For REAL or COMPLEX arrays, you should consider using a suitably small tolerance when comparing values. This and the previous tip are from urbanjost. pic.twitter.com/qjaMf5T06W
— FortranTip (@fortrantip) December 28, 2021
- 1
From the perspective of FortranTip Browser, “draft” means that it hasn’t been edited for formatting, hasn’t had corresponding Fortran programs added, the text content hasn’t been enhanced, etc. Draft texts are extracted from the corresponding Tweet using the Twitter API.