All pastes #398880 Raw Edit

Something

public text v1 · immutable
·published 2007-03-17 16:39 UTC
rendered paste body
alias math {
  tokenize 61 $1-
  %.z = $remove($3,$chr(32))
  %.v = $1
  tokenize 32 $2
  $regsub($1-,/[0-9]/g,$null,%.x)
  $regsub($replace($1-,+,$chr(32),-,$chr(32),/,$chr(32),*,$chr(32),^,$chr(32),%,$chr(32)),/[a-z-A-Z]/g,$null,%.y)
  tokenize 32 %.y
  %.x = $remove(%.x,$chr(32))
  echo -a *1: %.z $replacex(%.x,/,*,-,+,*,/,+,-) $1 $replacex(%.x,/,*,-,+,*,/,+,-) $2
  echo -a *2: %.v = $calc(%.z $replacex(%.x,/,*,-,+,*,/,+,-) $1 $replacex(%.x,/,*,-,+,*,/,+,-) $2)
  /unset %.*
}