dpchst Function

private pure function dpchst(arg1, arg2) result(s)

DPCHIP Sign-Testing Routine

Returns:

  • -1. if ARG1 and ARG2 are of opposite sign.
    1. if either argument is zero.
  • +1. if ARG1 and ARG2 are of the same sign.

The object is to do this without multiplying ARG1*ARG2, to avoid possible over/underflow problems.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: arg1
real(kind=wp), intent(in) :: arg2

Return Value real(kind=wp)


Called by

proc~~dpchst~~CalledByGraph proc~dpchst pchip_module::dpchst proc~dpchce pchip_module::dpchce proc~dpchce->proc~dpchst proc~dpchci pchip_module::dpchci proc~dpchci->proc~dpchst proc~dpchcs pchip_module::dpchcs proc~dpchcs->proc~dpchst proc~dpchim pchip_module::dpchim proc~dpchim->proc~dpchst proc~dpchic pchip_module::dpchic proc~dpchic->proc~dpchce proc~dpchic->proc~dpchci proc~dpchic->proc~dpchcs

Source Code

    pure function dpchst (arg1, arg2) result(s)

    real(wp),intent(in) :: arg1
    real(wp),intent(in) :: arg2
    real(wp) :: s

    if ((arg1==zero) .or. (arg2==zero)) then
        s = zero
    else
        s = sign(one,arg1) * sign(one,arg2)
    end if

    end function dpchst