Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -1,16 +1,17 @@
#define system.
#define system'math.
#define extensions.
// --- Program ---
#symbol program =
[
#var a := consoleEx readLine:(Integer new).
#var b := consoleEx readLine:(Integer new).
#var(type:int) a := consoleEx readLine:(Integer new) int.
#var(type:int)b := consoleEx readLine:(Integer new) int.
consoleEx << a << " + " << b << " = " << a + b << "%n".
consoleEx << a << " - " << b << " = " << a - b << "%n".
consoleEx << a << " * " << b << " = " << a * b << "%n".
consoleEx << a << " / " << b << " = " << a / b << "%n". // truncates towards 0
consoleEx << a << " %% " << b << " = " << (a~mathOp mod:b) << "%n". // matches sign of first operand
consoleEx writeLine:a:" + ": b:" = ":(a + b).
consoleEx writeLine:a:" - ": b:" = ":(a - b).
consoleEx writeLine:a:" * ": b:" = ":(a * b).
consoleEx writeLine:a:" / ": b:" = ":(a / b). // truncates towards 0
consoleEx writeLine:a:" %% ":b:" = ":(a mod:b). // matches sign of first operand
].