method

save_exception_mode

Importance_1
v2_6_3 - Show latest stable - 0 notes - Class: BigDecimal
save_exception_mode() public

Execute the provided block, but preserve the exception mode

BigDecimal.save_exception_mode do
  BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
  BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)

  BigDecimal(BigDecimal('Infinity'))
  BigDecimal(BigDecimal('-Infinity'))
  BigDecimal(BigDecimal('NaN'))
end

For use with the BigDecimal::EXCEPTION_*

See BigDecimal.mode

Show source
Register or log in to add new notes.