--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: Divides by the specified value, and returns the quotient and modulus as BigDecimal numbers. The quotient is rounded towards negative infinity. - !ruby/struct:SM::Flow::P body: "For example:" - !ruby/struct:SM::Flow::P body: require 'bigdecimal' - !ruby/struct:SM::Flow::P body: a = BigDecimal.new("42") b = BigDecimal.new("9") - !ruby/struct:SM::Flow::P body: q,m = a.divmod(b) - !ruby/struct:SM::Flow::P body: c = q * b + m - !ruby/struct:SM::Flow::P body: a == c -> true - !ruby/struct:SM::Flow::P body: The quotient q is (a/b).floor, and the modulus is the amount that must be added to q * b to get a. full_name: BigDecimal#divmod is_singleton: false name: divmod params: (p1) visibility: public