Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In C or C++, does the compiler option of floating point precision really make a difference in real world (small/indie) games?

From my observations, setting fp:fast is many times faster than fp:precise and from what I understand here ( ) the precision difference between the two compiler options only changes from the 16th digit of a floating point number.

Has anyone encountered an example when using fp:fast went terribly wrong for 2D or 3D games?

Edit: To clarify, I am not asking about the precision of floating point values themselves (ie. float vs double vs decimal). Only about precision related to the compiler option.

share|improve this question
up vote 9 down vote accepted

Your interpretation of fp:fast vs fp:precise sounds suspicious; I'm sure there's more of an effect than just rounding error after the 16th decimal place. I refer you to Bruce Dawson's article on floating point precision for more details.

In general, floating-point precision error is definitely a real problem in game development. It's especially troublesome for physics programmers and for games with large worlds or long running times (on the order of weeks or months, like an MMO). Floating point precision errors most often manifest as simulation instability and jittery movement that gradually gets worse over time. If you're not seeing those sorts of artifacts in your game, and the performance increase is significant, then it should definitely be safe to stick with fp:fast.

share|improve this answer
-1 Floating point precision is not a major problem in game development. Choosing wrong data types and lack of numerical knowledge and algorithms is the cause of all the problems mentioned in this post. All projects I participated used fp:fast with none of the problems mentioned. – Maik Semder Aug 24 '12 at 9:23
Yes, our conclusions are the same. My point was that floating point precision can be a problem in certain areas of game development, and that's why (in those areas) you need the numerical knowledge and proper data types you mentioned. – postgoodism Aug 24 '12 at 16:04
+1 for both great link, and for the answer you gave maik semder. I've also seen people struggling with those kind of errors, simply because they don't know what kind of operations they should use in their codes. – Ali.S Aug 24 '12 at 22:09
@postgoodism Thanks for answering. Not ignoring your input. Just may wait another day or two to see if I get more responses. – Inisheer Aug 25 '12 at 6:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.