Not sure if these have been posted but you can use these like this
$add(2,2) returns 4
$div(10,2) returns 5
$sub(2,1) returns 1
$mult(5,5) returns 25
$expo(2,2) returns 4
If I missed any, let me know and ill add them, Again its not much.
alias add return $calc($1 + $2)
alias div return $calc($1 / $2)
alias sub return $calc($1 - $2)
alias mult return $calc($1 * $2)
alias expo return $calc($1 ^ $2)
lmfao.
alias add return $calc($replace($1-,$chr(32),+))
mine actually does what kirbys is supposed to do.
even better
alias cal return $calc($replace($1-,$chr(32),$$iif($prop = a,+,$iif($prop = m,*,$iif($prop = d,/,$iif($prop = s,-,$iif($prop = e,^)))))))
usage $cal(1,2,3,4).[m,a,s,e,d]
letters stand for obvious things.
Those identifiers only deal with two numbers. How about taking that further so you can perform calculations with multiple numbers?
I've devised a rather simple script for $add.
alias add { var %x 1 | while (%x <= $numtok($1-,32)) { var %y $calc($gettok($1-,%x,32) + %y) | inc %x } | return %y }
Usage: $add(1,2,3,4,5) returns 15
I think you can make better use with the other identifiers now, if you want, by using what I supplied as a guide.