Abs()
Blitz3D Forums/Blitz3D Programming/Abs()
| ||
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! |
| ||
You are using Mod incorrectly. |
| ||
Oh, wow. *brainfart* How did I skip over that in the documentation...... :| I see now. Thanks! |