lib/dentaku/binary_operation.rb in dentaku-1.0.0 vs lib/dentaku/binary_operation.rb in dentaku-1.1.0
- old
+ new
@@ -13,10 +13,10 @@
def multiply; [:numeric, left * right]; end
def divide
quotient, remainder = left.divmod(right)
return [:numeric, quotient] if remainder == 0
- [:numeric, left.to_f / right.to_f]
+ [:numeric, BigDecimal.new(left.to_s) / BigDecimal.new(right.to_s)]
end
def mod; [:numeric, left % right]; end
def le; [:logical, left <= right]; end