Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Arithmetic-Integer/Genie/arithmetic-integer.genie
Normal file
21
Task/Arithmetic-Integer/Genie/arithmetic-integer.genie
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
[indent=4]
|
||||
/*
|
||||
Arithmethic/Integer, in Genie
|
||||
valac arithmethic-integer.gs
|
||||
*/
|
||||
|
||||
init:int
|
||||
a:int = 0
|
||||
b:int = 0
|
||||
if args.length > 2 do b = int.parse(args[2])
|
||||
if args.length > 1 do a = int.parse(args[1])
|
||||
|
||||
print @"a+b: $a plus $b is $(a+b)"
|
||||
print @"a-b: $a minus $b is $(a-b)"
|
||||
print @"a*b: $a times $b is $(a*b)"
|
||||
print @"a/b: $a by $b quotient is $(a/b) (rounded mode is TRUNCATION)"
|
||||
print @"a%b: $a by $b remainder is $(a%b) (sign matches first operand)"
|
||||
|
||||
print "\nGenie does not include a raise to power operator"
|
||||
|
||||
return 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue