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

Square Wave Function
Math Arithmetic Class

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

Function whose output resembles a square wave.

Examples:
    SquareWave(-2.0) = 1
    SquareWave(-1.5) = 1
    SquareWave(-1.0) = -1
    SquareWave(-0.5) = -1
    SquareWave(+0.0) = 1
    SquareWave(+0.5) = 1
    SquareWave(+1.0) = -1
    SquareWave(+1.5) = -1
    SquareWave(+2.0) = 1
See also:
    SquareWaveSample Subroutine
    SawtoothWave Function
    Sine Function, et. al.
    Floor Function
    ^ Operator (Visual Basic)
vNumber: The X position of the square wave whose Y position will be returned. Function returns Null if vNumber is Null or cannot be fixed up to a number.

Definition:

    (-1) ^ Floor(X)

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