Jump to content

Simplifying Number


Err

Recommended Posts

function simplifyNum($num) {  $num = ($num % 2 === 0) ? simplifyNum($num/2) : $num;  return $num;}$num = simplifyNum($num);

If I put in 10, it does not simplify the number down to 5. It stays 10. Why?Never mind. This works, I was just calling it wrong.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...