Sha256: d3101e482b6e4446c0e01d4031dec628e8971665efa88989fda075dd004f3e58

Contents?: true

Size: 316 Bytes

Versions: 21

Compression:

Stored size: 316 Bytes

Contents

unless Float.method_defined? :prev_float
  require 'backports/tools/float_integer_conversion'
  require 'backports/1.9.2/float/infinity'

  class Float
    def prev_float
      return -Float::INFINITY if self == -Float::INFINITY
      Backports.integer_to_float(Backports.float_to_integer(self)-1)
    end
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/backports-3.12.0/lib/backports/2.2.0/float/prev_float.rb
backports-3.16.1 lib/backports/2.2.0/float/prev_float.rb
backports-3.16.0 lib/backports/2.2.0/float/prev_float.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/backports-3.15.0/lib/backports/2.2.0/float/prev_float.rb
backports-3.15.0 lib/backports/2.2.0/float/prev_float.rb
backports-3.14.0 lib/backports/2.2.0/float/prev_float.rb
backports-3.13.0 lib/backports/2.2.0/float/prev_float.rb
backports-3.12.0 lib/backports/2.2.0/float/prev_float.rb
backports-3.11.4 lib/backports/2.2.0/float/prev_float.rb
backports-3.11.3 lib/backports/2.2.0/float/prev_float.rb
backports-3.11.2 lib/backports/2.2.0/float/prev_float.rb
backports-3.11.1 lib/backports/2.2.0/float/prev_float.rb
backports-3.11.0 lib/backports/2.2.0/float/prev_float.rb
backports-3.10.3 lib/backports/2.2.0/float/prev_float.rb
backports-3.10.2 lib/backports/2.2.0/float/prev_float.rb
backports-3.10.1 lib/backports/2.2.0/float/prev_float.rb
backports-3.10.0 lib/backports/2.2.0/float/prev_float.rb
backports-3.9.1 lib/backports/2.2.0/float/prev_float.rb
backports-3.9.0 lib/backports/2.2.0/float/prev_float.rb
backports-3.8.0 lib/backports/2.2.0/float/prev_float.rb