<-- Previous || Up || Next -->

Step Fn Function
Math Reals Class

Public Function StepFn( _
    ByVal vX As Variant _
    ) As Variant

"Step Function"
Returns 0 if X < 0; .5 if X = 0; 1 if X > 0.

Summary:
    If X < 0: Return 0.
    If X = 0: Return .5
    If X > 0: Return 1.
Examples:
    StepFn(-1) = 0
    StepFn(0) = 0.5
    StepFn(1) = 1
    StepFn(23) = 1
See also:
    StepFnVerify Subroutine
    Sign Function
    Sgn Function (Visual Basic)
Definition:
    Sgn(vX) / 2 + 1 / 2
vX: Number whose step (as defined above) is returned. Function returns Null if vX is Null or cannot be fixed up to a number.

v1.5 BugFix: Corrected this function to return 0 (zero) instead of -1 when vX is a negative number.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.