appacademy / prep-work

preparatory material for interviewing with App Academy
291 stars 339 forks source link

09-is-power-of-two.rb #60

Closed Willardgmoore closed 9 years ago

Willardgmoore commented 9 years ago

I'm not sure if I just misunderstand the directions or if it is a legitimate error that is_power_of_two(25) returns FALSE. The way I understand it, the directions indicate that they would like it to return TRUE being that 5**2 is 25.

If I am right in my assumption, would you still put this as a medium or would it be hard? I haven't applied yet, but I'm working on it.

aplarson commented 9 years ago

25 is not a power of 2; it is a square number. The powers of 2 are: 2^1 (2), 2^2 (4), 2^3 (8), 2^4(16), and so forth.

Willardgmoore commented 9 years ago

Thank you for the clarification. I figured I was over l was too close to the issue.