R/MRatCalcpowered by RiX

RiX walkthrough 2 a

Operators and precedence

Group arithmetic, test divisibility, and compare exact values.

Group an expression

Powers run before multiplication, then addition. 2 + 3 * 4 ^ 2 therefore returns 50. Parentheses let you make a different grouping explicit.

Runnable RiX

The second result is 80. Change the exponent and predict both results.

Ask about a number

% returns a remainder. Test it against zero with == to ask about divisibility. The first answer is true (1); the second is false (_).

Runnable RiX

n := 14 names a value; n == 14 compares it. Zero itself is truthy, so always make the test explicit in a conditional.

Call a function explicitly

Parentheses make arguments unambiguous. You can explore RiX's adjacent application later, after ordinary calls are comfortable.

Runnable RiX

The results are 7 and 8. Continue with Collections and text, or read Define and call for more function examples.