13 lines
234 B
ChaiScript
13 lines
234 B
ChaiScript
def numFunc(x)
|
|
{
|
|
return x + 10;
|
|
}
|
|
|
|
|
|
// Note that unary prefix `-` has lower precedence than `.`
|
|
// this is why these values are correct, even if counterintuitive
|
|
|
|
assert_true(-5.numFunc() == -15);
|
|
assert_true((-5).numFunc() == 5);
|
|
|