Small functions for making semantically-correct code that doesn't raise compiler warnings (or at least, fewer). The main downside of this is requiring a function call, which can destroy vectorisation of loops.
Are two numbers exactly equal to each other
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | a | |||
real(kind=real32), | intent(in) | :: | b |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | a | |||
real(kind=real64), | intent(in) | :: | b |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | a | |||
real(kind=real128), | intent(in) | :: | b |
Are two numbers not exactly equal to each other
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | a | |||
real(kind=real32), | intent(in) | :: | b |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | a | |||
real(kind=real64), | intent(in) | :: | b |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | a | |||
real(kind=real128), | intent(in) | :: | b |
Is the argument exactly equal to zero
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | scalar |
Is the argument not exactly zero
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | scalar |
Are two numbers almost equal within some tolerance
Are two numbers almost equal
Uses the same predicate as numpy's isclose
:
abs(a - b) <= (atol + rtol * abs(b))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | a | |||
real(kind=real32), | intent(in) | :: | b | |||
real(kind=real32), | intent(in), | optional | :: | rtol | ||
real(kind=real32), | intent(in), | optional | :: | atol |
Are two numbers almost equal
Uses the same predicate as numpy's isclose
:
abs(a - b) <= (atol + rtol * abs(b))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | a | |||
real(kind=real64), | intent(in) | :: | b | |||
real(kind=real64), | intent(in), | optional | :: | rtol | ||
real(kind=real64), | intent(in), | optional | :: | atol |
Are two numbers almost equal
Uses the same predicate as numpy's isclose
:
abs(a - b) <= (atol + rtol * abs(b))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | a | |||
real(kind=real128), | intent(in) | :: | b | |||
real(kind=real128), | intent(in), | optional | :: | rtol | ||
real(kind=real128), | intent(in), | optional | :: | atol |
Is the argument almost zero
Is a scalar almost zero
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | scalar | |||
real(kind=real32), | intent(in), | optional | :: | rtol | ||
real(kind=real32), | intent(in), | optional | :: | atol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | scalar | |||
real(kind=real64), | intent(in), | optional | :: | rtol | ||
real(kind=real64), | intent(in), | optional | :: | atol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | scalar | |||
real(kind=real128), | intent(in), | optional | :: | rtol | ||
real(kind=real128), | intent(in), | optional | :: | atol |
Returns , the square modulus of a complex number
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=real32), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=real64), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=real128), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | a | |||
real(kind=real32), | intent(in) | :: | b |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | a | |||
real(kind=real64), | intent(in) | :: | b |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | a | |||
real(kind=real128), | intent(in) | :: | b |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | a | |||
real(kind=real32), | intent(in) | :: | b |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | a | |||
real(kind=real64), | intent(in) | :: | b |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | a | |||
real(kind=real128), | intent(in) | :: | b |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | scalar |
Are two numbers almost equal
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | a | |||
real(kind=real32), | intent(in) | :: | b | |||
real(kind=real32), | intent(in), | optional | :: | rtol | ||
real(kind=real32), | intent(in), | optional | :: | atol |
Are two numbers almost equal
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | a | |||
real(kind=real64), | intent(in) | :: | b | |||
real(kind=real64), | intent(in), | optional | :: | rtol | ||
real(kind=real64), | intent(in), | optional | :: | atol |
Are two numbers almost equal
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | a | |||
real(kind=real128), | intent(in) | :: | b | |||
real(kind=real128), | intent(in), | optional | :: | rtol | ||
real(kind=real128), | intent(in), | optional | :: | atol |
Is a scalar almost zero
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | scalar | |||
real(kind=real32), | intent(in), | optional | :: | rtol | ||
real(kind=real32), | intent(in), | optional | :: | atol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | scalar | |||
real(kind=real64), | intent(in), | optional | :: | rtol | ||
real(kind=real64), | intent(in), | optional | :: | atol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real128), | intent(in) | :: | scalar | |||
real(kind=real128), | intent(in), | optional | :: | rtol | ||
real(kind=real128), | intent(in), | optional | :: | atol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=real32), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=real64), | intent(in) | :: | scalar |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=real128), | intent(in) | :: | scalar |