Sha256: c1dc8f29a65d2cce46c3183572a6d7cfe1b9eeb650542fbfba01f7fcb02f42ff

Contents?: true

Size: 216 Bytes

Versions: 3

Compression:

Stored size: 216 Bytes

Contents

class Numeric 
	# equivalent to `a.fdiv(b).ceil`. +1
	#
	# @param [Numeric] num
	# @return [Numeric]
	def div2(num)
		d, m = divmod(num)
		d + (m==0 ? 0 : 1)
	end
end

require "active_support/core_ext/numeric/bytes"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tagen-2.0.2 lib/tagen/core/numeric.rb
tagen-2.0.1 lib/tagen/core/numeric.rb
tagen-2.0.0 lib/tagen/core/numeric.rb