True for negative values. The result for negative zero is processor
dependent, so callers must not rely on it: every caller here tests
value == 0 first and drops the sign for zero. Not valid for NaN,
which the callers have already filtered out.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | value |
pure function is_negative(value) result(negative) !! True for negative values. The result for negative zero is processor !! dependent, so callers must not rely on it: every caller here tests !! `value == 0` first and drops the sign for zero. Not valid for NaN, !! which the callers have already filtered out. real(dp), intent(in) :: value logical :: negative negative = sign(1.0_dp, value) < 0.0_dp end function is_negative