is_negative Function

private 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.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: value

Return Value logical


Called by

proc~~is_negative~~CalledByGraph proc~is_negative is_negative proc~to_string_fixed_dp to_string_fixed_dp proc~to_string_fixed_dp->proc~is_negative proc~to_string_sci_dp to_string_sci_dp proc~to_string_sci_dp->proc~is_negative interface~to_string_fixed to_string_fixed interface~to_string_fixed->proc~to_string_fixed_dp proc~to_string_fixed_sp to_string_fixed_sp interface~to_string_fixed->proc~to_string_fixed_sp interface~to_string_sci to_string_sci interface~to_string_sci->proc~to_string_sci_dp proc~to_string_sci_sp to_string_sci_sp interface~to_string_sci->proc~to_string_sci_sp proc~to_string_fixed_sp->proc~to_string_fixed_dp proc~to_string_sci_sp->proc~to_string_sci_dp

Source Code

   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