Maximum and minimum value of Fixnum and Bignum in Ruby

I am interested in the range of Fixnum and Bignum. In Float, I can get the range of Float with Float :: MAX and Float :: MIN. There are no similar constants in Fixnum and Bignum. What is the best way to achieve this?

+4
source share
1 answer

Forget Fixnumand Bignum. These are private internal implementation details. This is an optimization. You must ignore them. The only class you need to worry about is Integer.

ISO Ruby Language Specification defines a class only Integer. It allows you to use implementation-specific subclasses, but it does not specify them.

Fixnum - , . flonums YARV. , flonums YARV 2.0? , , Float. . .

YARV 2.4 Fixnum Bignum Integer . Fixnum Bignum Integer, , .

Ruby Integer ; . .

Fixnum ( ) . JRuby Fixnum 64-, YARV 63- 64- 31- 32- . Opal Integer ECMAScript Number ( IEEE754 53 ), , Fixnum Bignum s.

+5

Source: https://habr.com/ru/post/1657703/


All Articles