Sub Math Arithmetic Class

SquareWaveSample

Signature (Visual Basic / VBA)

Private Sub SquareWaveSample()
    ' Print some samples of the SquareWave function.

    Const strFormat = " 0.0;-0.0"

    Dim dblX As Double
    For dblX = -4 To 4 Step 0.5
        Debug.Print "SquareWave(" & Format$(dblX, strFormat) & ") = ";
        Debug.Print Format$(SquareWave(dblX), strFormat)
    Next dblX
End Sub