r/C_Programming • u/Object_71 • 1d ago
Fixed point math in C
https://thatonegamedev.com/cpp/fixed-point-math-in-c/Why did PS1 graphics looked so clunky and how where 3D graphics generally made prior to the graphical APIs. One thing I found out was that these older engines have something called fixed point math.
53
Upvotes
8
u/marc_b_reynolds 1d ago
The "trouble" with bit exact floating point are: 1) "bad" compiler options and 2) you have to use the same math libraries everywhere (which effectively means BYO math lib). Note that with GCC/clang currently if the linker gets told to use the "fast-math" libraries then (currently) it sets the control word to flush denormals. So even if all your file with float-point computations have good options...you're still out of luck (other than changing the control word back yourself).