--- !ruby/object:RI::MethodDescription
aliases: []
block_params:
comment:
- !ruby/struct:SM::Flow::P
body: "If aNumeric is the same type as num, returns an array containing aNumeric and num. Otherwise, returns an array with both aNumeric and num represented as Float objects. This coercion mechanism is used by Ruby to handle mixed-type numeric operations: it is intended to find a compatible common type between the two operands of the operator."
- !ruby/struct:SM::Flow::VERB
body: " 1.coerce(2.5) #=> [2.5, 1.0]\n 1.2.coerce(3) #=> [3.0, 1.2]\n 1.coerce(2) #=> [2, 1]\n"
full_name: Numeric#coerce
is_singleton: false
name: coerce
params: |
num.coerce(numeric) => array
visibility: public