mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 16:57:04 +08:00
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);
|
|
|