heaviside Function

public elemental function heaviside(x)

Arguments

Type IntentOptional Attributes Name
real(kind=8), intent(in) :: x

Return Value real(kind=8)


Source Code

  elemental function heaviside(x)
    real(8),intent(in) :: x
    real(8)            :: heaviside
    if(x < 0.d0) then
       heaviside = 0.0d0
    elseif(x==0.d0)then
       heaviside = 0.50d0
    else
       heaviside = 1.0d0
    endif
  end function heaviside