--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: Controls handling of arithmetic exceptions and rounding. If no value is supplied, the current value is returned. - !ruby/struct:SM::Flow::P body: "Six values of the mode parameter control the handling of arithmetic exceptions:" - !ruby/struct:SM::Flow::P body: BigDecimal::EXCEPTION_NaN BigDecimal::EXCEPTION_INFINITY BigDecimal::EXCEPTION_UNDERFLOW BigDecimal::EXCEPTION_OVERFLOW BigDecimal::EXCEPTION_ZERODIVIDE BigDecimal::EXCEPTION_ALL - !ruby/struct:SM::Flow::P body: "For each mode parameter above, if the value set is false, computation continues after an arithmetic exception of the appropriate type. When computation continues, results are as follows:" - !ruby/object:SM::Flow::LIST contents: - !ruby/struct:SM::Flow::LI label: "EXCEPTION_NaN:" body: NaN - !ruby/struct:SM::Flow::LI label: "EXCEPTION_INFINITY:" body: +infinity or -infinity - !ruby/struct:SM::Flow::LI label: "EXCEPTION_UNDERFLOW:" body: "0" - !ruby/struct:SM::Flow::LI label: "EXCEPTION_OVERFLOW:" body: +infinity or -infinity - !ruby/struct:SM::Flow::LI label: "EXCEPTION_ZERODIVIDE:" body: +infinity or -infinity type: :NOTE - !ruby/struct:SM::Flow::P body: "One value of the mode parameter controls the rounding of numeric values: BigDecimal::ROUND_MODE. The values it can take are:" - !ruby/object:SM::Flow::LIST contents: - !ruby/struct:SM::Flow::LI label: "ROUND_UP:" body: round away from zero - !ruby/struct:SM::Flow::LI label: "ROUND_DOWN:" body: round towards zero (truncate) - !ruby/struct:SM::Flow::LI label: "ROUND_HALF_UP:" body: round up if the appropriate digit >= 5, otherwise truncate (default) - !ruby/struct:SM::Flow::LI label: "ROUND_HALF_DOWN:" body: round up if the appropriate digit >= 6, otherwise truncate - !ruby/struct:SM::Flow::LI label: "ROUND_HALF_EVEN:" body: round towards the even neighbor (Banker's rounding) - !ruby/struct:SM::Flow::LI label: "ROUND_CEILING:" body: round towards positive infinity (ceil) - !ruby/struct:SM::Flow::LI label: "ROUND_FLOOR:" body: round towards negative infinity (floor) type: :NOTE full_name: BigDecimal::mode is_singleton: true name: mode params: | BigDecimal.mode(mode, value) visibility: public