Sha256: 34e18527fa4affe4578e8bcc3e2077bef7c3c061cefdbd2f7e2f7342c4cb4cd9

Contents?: true

Size: 672 Bytes

Versions: 1

Compression:

Stored size: 672 Bytes

Contents

# = General number utilities collection
#
# code: gmosx
#
# (c) 2004 Navel, all rights reserved.
# $Id: number.rb 71 2004-10-18 10:50:22Z gmosx $

module N;

# = NumberUtils
#
# === Design:
#
# Implement as a module to avoid class polution. You can
# still Ruby's advanced features to include the module in your
# class. Passing the object to act upon allows to check for nil,
# which isn't possible if you use self.
#
module NumberUtils

	# Returns the multiple ceil of a number
	#
	def self.ceil_multiple(num, multiple)
		# gmosx: to_f is needed!s
		# gmosx: IS THERE a more optimized way to do this?
		return ((num.to_f/multiple).ceil*multiple)
	end

end

end # module

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.1.2 lib/n/utils/number.rb