Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 deletions
|
|
@ -1,14 +1,17 @@
|
|||
#define std'basic'*.
|
||||
#define math'* = std'math'*.
|
||||
#define system.
|
||||
#define extensions'io.
|
||||
#define extensions'math.
|
||||
|
||||
#symbol Program =
|
||||
// --- Program ---
|
||||
|
||||
#symbol program =
|
||||
[
|
||||
#var a := 'program'input >> Integer.
|
||||
#var b := 'program'input >> Integer.
|
||||
#var a := consoleEx readLine:(Integer new).
|
||||
#var b := consoleEx readLine:(Integer new).
|
||||
|
||||
'program'output << a << " + " << b << " = " << a + b << "%n".
|
||||
'program'output << a << " - " << b << " = " << a - b << "%n".
|
||||
'program'output << a << " * " << b << " = " << a * b << "%n".
|
||||
'program'output << a << " / " << b << " = " << a / b << "%n". // truncates towards 0
|
||||
'program'output << a << " %% " << b << " = " << a~math'eops math'modulus:b << "%n". // matches sign of first operand
|
||||
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 << " = " << (modulus:a:b) << "%n". // matches sign of first operand
|
||||
].
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue