File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 158158
159159 module procedure within_real
160160
161- if (abs (operands% actual - operands% expected) < tolerance) then
161+ if (abs (operands% actual - operands% expected) <= tolerance) then
162+ ! We use <= to allow for tolerance=0, which could never be satisfied if we used < instead:
162163 test_diagnosis = test_diagnosis_t(test_passed= .true. , diagnostics_string= " " )
163164 else
164165 test_diagnosis = test_diagnosis_t(test_passed= .false. &
172173
173174 module procedure within_double_precision
174175
175- if (abs (operands% actual - operands% expected) < tolerance) then
176+ if (abs (operands% actual - operands% expected) <= tolerance) then
177+ ! We use <= to allow for tolerance=0, which could never be satisfied if we used < instead:
176178 test_diagnosis = test_diagnosis_t(test_passed= .true. , diagnostics_string= " " )
177179 else
178180 test_diagnosis = test_diagnosis_t(test_passed= .false. &
You can’t perform that action at this time.
0 commit comments