Err Posted April 26, 2010 Share Posted April 26, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.