Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
max & min math functions
#2
Here's my hacky user-defined max function, is there more efficient code?
Function MaxInt
Code:
Copy      Help
;/
function#  value0 value1 [value2] [value3] [value4] [value5] [value6] [value7] [value8] [value9] [value10]


int* value = &value0
int maxval=value0
for(int'i 1 getopt(nargs))
,maxval=(maxval*(maxval>value[i])) + (value[i]*(value[i]>maxval)) + (maxval*(maxval=value[i]))
ret maxval


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)