Sha256: e97f29df836cbd0407183a670ac028f2b2f7410787a72ead98f5af6ca98580f9

Contents?: true

Size: 353 Bytes

Versions: 14

Compression:

Stored size: 353 Bytes

Contents

class Fixnum
  # Standard in ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/Fixnum.html]
  def div(n)
    (self / n).round
  end unless method_defined? :div

  # Standard in ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/Fixnum.html]
  def fdiv(n)
    to_f / n
  end unless method_defined? :fdiv
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
marcandre-backports-1.6.0 lib/backports/fixnum.rb
marcandre-backports-1.6.1 lib/backports/fixnum.rb
marcandre-backports-1.6.3 lib/backports/fixnum.rb
marcandre-backports-1.6.4 lib/backports/fixnum.rb
marcandre-backports-1.6.6 lib/backports/fixnum.rb
marcandre-backports-1.6.7 lib/backports/fixnum.rb
marcandre-backports-1.6.8 lib/backports/fixnum.rb
backports-1.6.1 lib/backports/fixnum.rb
backports-1.6.3 lib/backports/fixnum.rb
backports-1.6.4 lib/backports/fixnum.rb
backports-1.6.7 lib/backports/fixnum.rb
backports-1.6.8 lib/backports/fixnum.rb
backports-1.6.0 lib/backports/fixnum.rb
backports-1.6.6 lib/backports/fixnum.rb