2017-08-24 11:38:40 +08:00
|
|
|
logmsg Validate basic expressions
|
2016-05-03 11:53:48 +08:00
|
|
|
math 3 / 2
|
|
|
|
math 10/6
|
|
|
|
math -s0 10 / 6
|
2018-07-24 15:00:06 +08:00
|
|
|
math 'floor(10 / 6)'
|
2016-05-03 11:53:48 +08:00
|
|
|
math -s3 10/6
|
|
|
|
math '10 % 6'
|
|
|
|
math -s0 '10 % 6'
|
|
|
|
math '23 % 7'
|
2017-07-15 07:03:31 +08:00
|
|
|
math --scale=6 '5 / 3 * 0.3'
|
2017-08-24 08:32:49 +08:00
|
|
|
math "7^2"
|
2017-07-15 07:03:31 +08:00
|
|
|
math -1 + 1
|
|
|
|
math '-2 * -2'
|
|
|
|
math 5 \* -2
|
|
|
|
math -- -4 / 2
|
|
|
|
math -- '-4 * 2'
|
2017-08-24 11:38:40 +08:00
|
|
|
|
2018-12-02 05:25:00 +08:00
|
|
|
logmsg Validate some rounding functions
|
|
|
|
math 'round(3/2)' ; math 'floor(3/2)' ; math 'ceil(3/2)'
|
|
|
|
math 'round(-3/2)' ; math 'floor(-3/2)' ; math 'ceil(-3/2)'
|
|
|
|
|
2018-07-24 15:00:06 +08:00
|
|
|
logmsg Validate some integral computations
|
|
|
|
math 1
|
|
|
|
math 10
|
|
|
|
math 100
|
|
|
|
math 1000
|
|
|
|
math '10^15'
|
|
|
|
math '-10^14'
|
|
|
|
math '-10^15'
|
|
|
|
|
|
|
|
math -s0 '1.0 / 2.0'
|
|
|
|
math -s0 '3.0 / 2.0'
|
|
|
|
math -s0 '10^15 / 2.0'
|
|
|
|
|
2017-12-18 04:31:39 +08:00
|
|
|
logmsg Validate how variables in an expression are handled
|
|
|
|
math $x + 1
|
2017-08-24 11:38:40 +08:00
|
|
|
set x 1
|
2017-12-18 04:31:39 +08:00
|
|
|
math $x + 1
|
2017-08-24 11:38:40 +08:00
|
|
|
set x 3
|
|
|
|
set y 1.5
|
2017-12-18 04:31:39 +08:00
|
|
|
math "-$x * $y"
|
2018-07-24 15:00:06 +08:00
|
|
|
math -s0 "-$x * $y"
|
2017-11-25 15:04:44 +08:00
|
|
|
|
|
|
|
logmsg Validate math error reporting
|
2018-02-26 18:25:35 +08:00
|
|
|
not math '2 - '
|
|
|
|
not math 'ncr(1)'
|
2017-11-25 15:04:44 +08:00
|
|
|
not math 'max()'
|
2018-02-26 18:25:35 +08:00
|
|
|
not math 'sin()'
|
2018-02-26 21:00:29 +08:00
|
|
|
not math '2 + 2 4'
|
2018-03-02 05:27:24 +08:00
|
|
|
not math
|
|
|
|
not math -s 12
|
2018-07-24 15:00:06 +08:00
|
|
|
not math 2^999999
|
2018-03-08 01:13:26 +08:00
|
|
|
not math 1 / 0
|