method

coerce

ruby latest stable - Class: Bignum

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2_2_9) is shown here.

coerce(p1)
public

Returns an array with both a numeric and a big represented as Bignum objects.

This is achieved by converting numeric to a Bignum.

A TypeError is raised if the numeric is not a Fixnum or Bignum type.

(0x3FFFFFFFFFFFFFFF+1).coerce(42)   #=> [42, 4611686018427387904]