Six ways of assigning a value after an operation already done:
- The older way:
$set $x=3.3 $mult 3
gives the value 9.899999999999999- not very readable
- The long way:
$set $x=3.3 $modify($x).mult(3)
gives the value 9.899999999999999 - The trick way:
$set $x=$NULL.plus(3.3).mult(3)
gives the value 9.899999999999999 - The newer way:
$setval $x=$mkvar(3.3).mult(3)
gives the value 9.899999999999999 (have to use $setval for now)- more readable, even though slightly longer
- The future way:
$set $x=$mkvar(3.3).mult(3)
gives the value 9.899999999999999 - Future compact way having first defined $V function as
$V=$mkvar($V_val)||$parameters $V V_val
Use this with:$set $x=$V(3.3).mult(3)
gives the value $V(3.3).mult(3)- Good if code needs to be compact
Four ways of printing a value with an operation already done on it:
- The older way:
$( 33.3 $mult 3 $)
gives the value 99.89999999999999- not very readable
- The long way:
$set $x=33.3 $x.mult(3)
gives the value 99.89999999999999 - The trick way:
$NULL.plus(33.3).mult(3)
gives the value 99.89999999999999 - The newer way:
$mkvar(33.3).mult(3)
gives the value 99.89999999999999- more readable, even though slightly longer
- Future compact way having first defined $V function as
$V=$mkvar($V_val)||$parameters $V V_val
Use this with:$V(3.3).mult(3)
gives the value 9.899999999999999 33.3- Good if code needs to be compact
- Login to post comments