Hacker News new | past | comments | ask | show | jobs | submit login

I don't - it's not my code I had to fix.

And as for returning the result - original code does return a float, so while I could also return a double it probably wouldn't make any difference, as I expect the game to store those results in floats too. Moreover, since the result is basically "session time", it is expected to last up to several hours - in which case floats are still fine.




I've often seen code like that written by mathematicians and physicists. Sigh.

Things like using a bit weird data types (floats instead of doubles) and writing functions thousands (!) of lines long.

Then asking me why did the reconstruction have a weird circular error around the origo...


Either way, it may indeed be beneficial to return time as a double - so code which stores it in floats will not care about the change, but the code which uses it in intermediate calculations will and it will potentially benefit from it. Notes taken!

EDIT: Will generate more code warnings of course, but I believe it's a good tradeoff, since the game has a ton of them anyway and going through them all is something for another day.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: