Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
MikeDucker
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
MikeDucker
14y ago
I think that's excellent advice, which I'll take if I end up using box2D in the end :)
2.
▲
by
MikeDucker
14y ago
I would follow the steps again (I am genuinely interested in learning why it does what it does), but I ripped out the scaling factor a few days ago and reintroducing it in the hope that the same thing happens would be a lot of work, hence a
3.
▲
by
MikeDucker
14y ago
I remember being told a long time ago by our graphics programmer that the result of a floating point operation might be different depending on the state of the FPU. A quick internet search brings up things like this: http://www.codercorner
4.
▲
by
MikeDucker
14y ago
I have certainly not had a bug that so plainly highlights this before. If it had been a bug about a more complex calculation than ( 4.0 * 0.1 ) / 0.1 I wouldn't have thought it worth mentioning. The fact that calc generally does result in a
5.
▲
by
MikeDucker
14y ago
I'm glad one person appreciates my main sin is ban punnery, with a minor in forgetting floating point gotchas. I feel like someone who just told an anecdote about a time they slipped over whilst running and now everyone assumes they never k
6.
▲
by
MikeDucker
14y ago
It's because I'm using ints for position data to allow fast look-ups of nearby objects in a very simple 2D environment. It's not about the speed of the same calculations between floats and ints (if that's what you were wondering).
7.
▲
by
MikeDucker
14y ago
Ah, I see. I'll update my post. Thanks.
8.
▲
by
MikeDucker
14y ago
I see what you're saying, but if you take the 111011 as representing 1/2 1/4 1/8 etc. then it does equal 0.921875. I'm presuming that this value is added onto 1 (fiddling with the tick boxes confirms this) to be used as the mantissa. I'm no
9.
▲
by
MikeDucker
14y ago
Are you saying that a floating point value just under 4 won't necessarily cast to 3 or something else? (I'm reading the above posted links, but am intrigued at what I've gotten wrong with my statement you quoted)
10.
▲
by
MikeDucker
14y ago
Hi acqq, I did type 123 into that float converter and the numbers I got back are what I posted. I'm not sure how we're getting different FP reps for the same number. I simply typed 123 into the decimal representation box. If I'm missing som
11.
▲
by
MikeDucker
14y ago
Thanks, that'll be very useful. I can quite blatantly do with learning more.
12.
▲
by
MikeDucker
14y ago
I never suggested this was a bug in how floating point works. I only meant I had a bug and it was due to my use of floats and how it bit me in the ass :) I am still a little surprised (but not that surprised) that essentially 4.0 * 0.1 (and
13.
▲
Indie game developer start-up interview #4, Rodeo Games
(mikeducker.wordpress.com)
5 points
by
MikeDucker
14y ago
|
0 comments
14.
▲
More game developer start-up experiences
(mikeducker.wordpress.com)
18 points
by
MikeDucker
14y ago
|
1 comments