Ruby automatically detects and converts between small and large integersthere is no need to use a trailing L at any time. There is no j literal for imaginary numbers. Use the Complex class from complex.rb to work with complex numbers. Use to_i and to_f to convert values.
Number objects are instances of a class like the others, and you can define methods for them.
class Fixnum def winner? self == 37 end end puts "Pick a number." if gets.to_i.winner? puts "Right!" else puts "Sorry." end
This is an example of extending a built-in class with Ruby.