Large Numbers : Bignum class « Number « Ruby






Large Numbers

rice_on_square = 1
64.times do |square|
  puts "On square #{square + 1} are #{rice_on_square} grain(s)"
  rice_on_square *= 2
end

 








Related examples in the same category

1.What is the start of Bignum
2.Declare the Variables to Store the Details