lib/code/object/decimal.rb in code-ruby-0.7.4 vs lib/code/object/decimal.rb in code-ruby-0.7.5
- old
+ new
@@ -7,10 +7,12 @@
def initialize(decimal, exponent: nil)
@raw = BigDecimal(decimal)
return unless exponent
- raise ::Code::Error::TypeError, "exponent is not a number" unless exponent.is_a?(Number)
+ unless exponent.is_a?(Number)
+ raise ::Code::Error::TypeError, "exponent is not a number"
+ end
@raw *= 10**exponent.raw
end
def self.name