...just thought, the compiler should also avoid 'endless' in it's error message
Absolute Val for Integers?
- Michael Vogel
- Addict

- Posts: 2820
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: Absolute Val for Integers?
Didn't want to start an 'endless' discussion 'bout that, sorry...
...just thought, the compiler should also avoid 'endless' in it's error message
...just thought, the compiler should also avoid 'endless' in it's error message
Re: Absolute Val for Integers?
Here's my version also just for the confusion of it
:
Code: Select all
Macro mMin(a, b)
(a) * Bool((a) And (((a) <= (b)) Or ((b) = 0))) + (b) * Bool((b) And (((b) < (a)) Or ((a) = 0)))
EndMacro
s.s = ""
Debug "m |-3 -2 -1 0 1 2 3"
Debug "--+--------------------"
For a = -3 To 3
s = "" + RSet(Str(a), 2, " ") + "|"
For b = -3 To 3
m = mMin(a, b)
s + RSet(Str(m), 2, " ") + " "
Next b
Debug s
Next aRe: Absolute Val for Integers?
In some cases the compiler can't evaluate the macro arguments first, because they might make sense only in combination with other macro content like concatenation with # inside the macro body. Avoiding the recursion error if caused by an argument may work but then actual endless recursion might be possible again.