-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Copied from BerkeleyLab/caffeine#251 :
real(c_double), parameter :: tolerance = 0_c_double
complex(c_double), dimension(size(values,1)) :: my_val, expected
...
diag = &
.all. (real(my_val, c_double) .approximates. real(expected, c_double) .within. tolerance) &
.also. (.all. (real(aimag(my_val), c_double) .approximates. real(aimag(expected), c_double) .within. tolerance))
It would be nice if Julienne's .approximates. had direct support for complex types, so that the user doesn't have to write awkward expressions like the one above; I'd rather be able to write simply:
my_val .approximates. expected .within. tolerance
where my_val and expected have type complex(rkind) and tolerance has type real(rkind) and is applied independently to each component as shown above.
The current code above presumably also generates a less helpful error message when only one of the components is outside tolerance.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request