lib/polyfill/v2_4/float/instance/ceil.rb in polyfill-0.3.0 vs lib/polyfill/v2_4/float/instance/ceil.rb in polyfill-0.4.0

- old
+ new

@@ -7,26 +7,24 @@ def ceil(ndigits = 0) ndigits = ndigits.to_int return super() if ndigits == 0 if ndigits > 0 - place = 10 ** ndigits + place = 10**ndigits (self * place).ceil / place.to_f else - place = 10 ** -ndigits - (self.to_f / place).ceil * place + place = 10**-ndigits + (self / place).ceil * place end end end - if RUBY_VERSION < '2.4.0' - refine ::Float do - include Method - end + refine ::Float do + include Method + end - def self.included(base) - base.include Method - end + def self.included(base) + base.include Method end end end end end