Method: Integer#factors

Defined in:
lib/epitools/core_ext/numbers.rb

#factorsObject

Returns the all the prime factors of a number.



370
371
372
373
# File 'lib/epitools/core_ext/numbers.rb', line 370

def factors
  Prime # autoload the prime module
  prime_division.map { |n,count| [n]*count }.flatten
end