Sha256: 2e6a161d899d67c062226599365c3ba5969dc123a8256aa9e27d596c4cf84f52
Contents?: true
Size: 692 Bytes
Versions: 10
Compression:
Stored size: 692 Bytes
Contents
Note: Using ''init:int'' and the ''return'' from the init block was introduced in release 0.43.92, February 2019. [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
Version data entries
10 entries across 7 versions & 1 rubygems