Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improves the floating point comparison with zero. The strategy is to use a relative tolerance for the ratio `minor.mag/major.mag`. The softening constant `1e-100` is chosen such that: 1. If `minor.mag == 0.0` then the ratio is always `0.0` and no division by zero occurs. 2. The value of `major.mag + 1e-100 == major.mag` for all biophysically sensible values of `major.mag`. If both `minor.mag` and `major.mag` are zero as floating point number, then check may fail to raise a exception.
- Loading branch information