just out of curiosity, which one is faster (on ASM backend)?
Code: Select all
Procedure Limit(x.l)
If x>255
x=255
ElseIf x<0
x=0
EndIf
ProcedureReturn x
EndProcedure
Code: Select all
Procedure Limit(x.l)
If x>255
ProcedureReturn 255
ElseIf x<0
ProcedureReturn 0
Else
ProcedureReturn x
EndIf
EndProcedure
Code: Select all
Procedure Limit(x.l)
If x>255
ProcedureReturn 255
ElseIf x<0
ProcedureReturn 0
EndIf
ProcedureReturn x
EndProcedure
I would guess the first one is the slowest, but how about the second and third? How does the Else affect speed? And I know, the difference (if any) is almost unmeasureable, I'm just asking out of curiosity.