RosettaCodeData/Task/Arithmetic-Complex/Ruby/arithmetic-complex-2.rb

5 lines
204 B
Ruby
Raw Permalink Normal View History

2013-04-10 14:58:50 -07:00
# Other ways to find the multiplicative inverse:
puts 1.quo a # always works
puts 1.0 / a # works, but forces floating-point math
puts 1 / a # might truncate to integer