HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.7.4/spec/ruby/library/bigdecimal/fixtures/classes.rb
module BigDecimalSpecs
  # helper method to sure that the global limit is reset back
  def self.with_limit(l)
    old = BigDecimal.limit(l)
    yield
  ensure
    BigDecimal.limit(old)
  end

  def self.with_rounding(r)
    old = BigDecimal.mode(BigDecimal::ROUND_MODE)
    BigDecimal.mode(BigDecimal::ROUND_MODE, r)
    yield
  ensure
    BigDecimal.mode(BigDecimal::ROUND_MODE, old)
  end
end