Mega Code Archive

 
Categories / Ruby / Language Basics
 

Math calculation

1 + 2                    # => 3: addition 1 * 2                    # => 2: multiplication 1 + 2 == 3               # => true: == tests equality 2 ** 1024                # 2 to the power 1024: Ruby has arbitrary size ints