Skip to content

Commit

Permalink
[DOC] Integer#coerce deals with also Float
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Dec 29, 2021
1 parent 27765a7 commit 5ca51dd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bignum.c
Expand Up @@ -6730,14 +6730,15 @@ rb_big_hash(VALUE x)

/*
* call-seq:
* big.coerce(numeric) -> array
* int.coerce(numeric) -> array
*
* Returns an array with both a +numeric+ and a +big+ represented as Bignum
* objects.
* Returns an array with both a +numeric+ and a +int+ represented as
* Integer objects or Float objects.
*
* This is achieved by converting +numeric+ to a Bignum.
* This is achieved by converting +numeric+ to an Integer or a Float.
*
* A TypeError is raised if the +numeric+ is not a Fixnum or Bignum type.
* A TypeError is raised if the +numeric+ is not an Integer or a Float
* type.
*
* (0x3FFFFFFFFFFFFFFF+1).coerce(42) #=> [42, 4611686018427387904]
*/
Expand Down

0 comments on commit 5ca51dd

Please sign in to comment.