Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -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
|
||||
].
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue