Mini-challenge: MAX(factors of 2 or 5)
|
01-19-2018, 02:40 PM
Post: #10
|
|||
|
|||
RE: Mini-challenge: MAX(factors of 2 or 5)
(01-19-2018 02:10 PM)pier4r Wrote: Then I don't see why checking through division it is "unelegant". I think Joe meant "slow." The problem with RPL, apparently, is that executing it is so slow that even a heavyweight primitive like FACTORS can outperform a mathematically more efficient user code algorithm. (01-19-2018 02:10 PM)pier4r Wrote: it is still unclear to me what happens when there is only 2, as in 32, or only 5, as in 625. It is a multiplicity of 0 for one factor still valid? Jeez, what is it with people and their phobia of multiplicity zero? It's like those people who are always saying that 0! = 1 is some "weird special case." Drives me nuts! /rant For 32, your program should return 5, because 32 = 2^5 * 5^0, and max(5, 0) = 5. By the same logic, the result for 625 should be 4. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)