Calculating the largest known prime in Ruby - JP Camara

06-Dec-2024 73
Looking to impress your Ruby friends by calculating the largest known prime, 2 ** 136_279_841-1? On Ruby 3.4.0-preview2 and earlier, 2 ** 136_279_841-1 logs a warning and returns Infinity 😔: 2 ** 136_279_841-1 # warning: in a**b, b may be too big # => Infinity Thanks to @mametter, Ruby 3.4 will.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle