method
exponent
v4.2.7 -
Show latest stable
- Class:
ActiveSupport::NumberHelper::NumberToHumanSizeConverter
exponent()private
No documentation available.
# File activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb, line 41
def exponent
max = STORAGE_UNITS.size - 1
exp = (Math.log(number) / Math.log(base)).to_i
exp = max if exp > max # avoid overflow for the highest unit
exp
end