Method: ELFTools::Util::ClassMethods#align
- Defined in:
- lib/elftools/util.rb
#align(num, bit) ⇒ Integer
Round up the number to be multiple of 2**bit.
19 20 21 22 23 24 |
# File 'lib/elftools/util.rb', line 19 def align(num, bit) n = 2**bit return num if (num % n).zero? (num + n) & ~(n - 1) end |