--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: Splits a BigDecimal number into four parts, returned as an array of values. - !ruby/struct:SM::Flow::P body: The first value represents the sign of the BigDecimal, and is -1 or 1, or 0 if the BigDecimal is Not a Number. - !ruby/struct:SM::Flow::P body: The second value is a string representing the significant digits of the BigDecimal, with no leading zeros. - !ruby/struct:SM::Flow::P body: The third value is the base used for arithmetic (currently always 10) as an Integer. - !ruby/struct:SM::Flow::P body: The fourth value is an Integer exponent. - !ruby/struct:SM::Flow::P body: If the BigDecimal can be represented as 0.xxxxxx*10**n, then xxxxxx is the string of significant digits with no leading zeros, and n is the exponent. - !ruby/struct:SM::Flow::P body: "From these values, you can translate a BigDecimal to a float as follows:" - !ruby/struct:SM::Flow::VERB body: " sign, significant_digits, base, exponent = a.split\n f = sign * "0.#{significant_digits}".to_f * (base ** exponent)\n" - !ruby/struct:SM::Flow::P body: (Note that the to_f method is provided as a more convenient way to translate a BigDecimal to a Float.) full_name: BigDecimal#split is_singleton: false name: split params: () visibility: public