Abs()

Blitz3D Forums/Blitz3D Programming/Abs()

Irvau(Posted 2015) [#1]
Well, I was making a simple triangle wave simulation thing, but I hit a snag. Abs() stated that it was "expecting an expression", even though I'm pretty sure I've provided it one.

Here's the code:

AppTitle("Abs Expecting Expressions Error")

Print(TriangleWaveY#(5.2,10))

Function TriangleWaveY#(CurrentX#,Period#)
	Local CurrentY# = Abs(Mod(CurrentX#,Period#) - (Period#/2))
	Return(CurrentY#)
End Function


Just as a side-note, the "CurrentY" local never really existed in the first place. It was integrated into the return statement. I decided to separate it for the sake of readability.

Thanks in advance!


Floyd(Posted 2015) [#2]
You are using Mod incorrectly.


Irvau(Posted 2015) [#3]
Oh, wow.

*brainfart*

How did I skip over that in the documentation......

:|

I see now.

Thanks!