View Single Post
 
Reply
Posted 2010-12-14, 10:48 AM in reply to WetWired's post starting "if(intNumber==0)return 0; int mag;..."
Really, you could use a log 2 operation then take the integer part instead of using the for loop, but then you may have to deal with floating point precision issues. That, along with swapping the left shift with an exponent operation would make the solution entirely mathmatical
Old
Profile PM WWW Search
WetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusion
 
 
WetWired