Sha256: 4d12d0254e2a321842f72224640a24c0f0583422ef4268fc5c729ea2fdad2e6a
Contents?: true
Size: 410 Bytes
Versions: 10
Compression:
Stored size: 410 Bytes
Contents
a = gets.not_nil!.to_i64 b = gets.not_nil!.to_i64 puts "Sum: #{a + b}" puts "Difference: #{a - b}" puts "Product: #{a * b}" puts "Quotient (float division): #{a / b}" # / always returns a float. puts "Quotient (floor division): #{a // b}" puts "Remainder: #{a % b}" # Sign of remainder matches that of the second operand (b). puts "Power: #{a ** b}" # Integers can only be raised to a positive exponent.
Version data entries
10 entries across 7 versions & 1 rubygems