lib/prime provides Integer#prime_division, but I always forget the name.
I think that #prime_factors is more suitable. I'd like to hear opinions
of English natives. What do you think?
Yusuke Endoh email@example.com
Updated by yugui (Yuki Sonoda) over 3 years ago
I am not against adding such an alias but I'd like to think with more inputs. At this moment, I don't have strong reason to justify the name.
From a certain perspective, the alias is simply wrong because the method returns not only prime factors of the receiver but also their multiplicities -- i.e. the prime division of the receiver.
200.prime_factors sometimes looks to return (or yield)
[2, 2, 2, 5, 5] as MATLAB does.
Mame, do you have any concrete examples which support your expectation to the return value? Or any suggestions from native English speakers or mathematicians?