EricBall Posted March 29, 2007 Share Posted March 29, 2007 Floating point is most useful when you have to deal with numbers over a wide range of magnitudes. (e.g. calculating the kninetic energy of an electron travelling at half the speed of light) But in a game you typically need numbers over a finite range (i.e. +/- 1,000,000 to a precision of 0.000,001), which is exactly what fixed point provides. Quote Link to comment Share on other sites More sharing options...
JamesD Posted April 1, 2007 Share Posted April 1, 2007 Floating point is most useful when you have to deal with numbers over a wide range of magnitudes. (e.g. calculating the kninetic energy of an electron travelling at half the speed of light) But in a game you typically need numbers over a finite range (i.e. +/- 1,000,000 to a precision of 0.000,001), which is exactly what fixed point provides. float is most useful when you have existing source code that depends on it and you don't want to rewrite it to port the software. Quote Link to comment Share on other sites More sharing options...
EricBall Posted April 2, 2007 Share Posted April 2, 2007 float is most useful when you have existing source code that depends on it and you don't want to rewrite it to port the software. In which case there may be some value in mapping various float sizes to fixed point lengths. i.e. single -> 8.8, float -> 16.16, double -> 32.32 Quote Link to comment Share on other sites More sharing options...
danwinslow Posted April 2, 2007 Share Posted April 2, 2007 (edited) float is most useful when you have existing source code that depends on it and you don't want to rewrite it to port the software. That is undeniably true, but it misses the point. You could make that argument about any number of things. For the general case, though, I don't consider floats a good utility/performance tradeoff in an 8bit compiler. Edited April 2, 2007 by danwinslow Quote Link to comment Share on other sites More sharing options...
JamesD Posted April 5, 2007 Share Posted April 5, 2007 float is most useful when you have existing source code that depends on it and you don't want to rewrite it to port the software. That is undeniably true, but it misses the point. You could make that argument about any number of things. For the general case, though, I don't consider floats a good utility/performance tradeoff in an 8bit compiler. No it doesn't. What you say is true but you still can't take a program and port it from one machine to the next without creating some sort of custom library for every machine you want it to run on and existing software will need to be rewritten to port it. You can actually use whatever decimal representation you want behind the scenes and the compiler could use it as a float library without software knowing the difference unless it requires more significant digits than your math lib. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.