Code: Select all
var differenceVar = var1 - var2
if (differenceVar < 0) {
differenceVar = 0
}The reason I need another way is that i have a function with a loop that performs this operation on several variables thousands of times and it's a bit slow so anything better than the above would speed it up dramatically.
Thanks