View Single Post
 
Reply
Posted 2010-12-14, 01:59 PM in reply to WetWired's post starting "Really, you could use a log 2 operation..."
WetWired said: [Goto]
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 mathematical
I don't know enough math to go into dealing with a semi-complex algorithm like that.

The solution you gave was more than enough. Took me a good 45-minutes to an hour to understand how your solution works. I had previously tried to figure out a solution using binary shifting and such, but failed. You nailed it though. So really, thank you so much. I really thought there was no better way to pull this off. I think I may have gotten a bit rusty from not being able to write code as often as I used to.
 
Work List
疲れていますから 寝むってありますね。 むずかしいです。 また、ケーキ屋で ケーキを食べていました。

I've considered being a translator, but I dunno. It feels like a lot of work. If someone gets angry then I have to deal with it, you know? I'd rather just relax.

 
Speed Test
 
Favorite Anime/Manga
#01 Clannad ~After Story~
#02 Trigun {Maximum}
#03 Koi Kaze
#04 Berserk
#05 Outlaw Star
#06 Slayers
#07 Desert Punk
#08 Spirited Away
#09 Fullmetal Alchemist
#10 Shakugan no Shana
#11 Death Note
#12 FLCL
#13 Tokyo Magnitude 8.0
#14 Toradora
#15 Gunslinger Girl

 
Anime List
Old
Profile PM WWW Search
Goodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to be
 
 
Goodlookinguy