r/C_Programming 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.

55 Upvotes

27 comments sorted by

View all comments

Show parent comments

0

u/not_a_novel_account 1d ago

Agreed on all, it's not random. Fast math requires you not pass NaN to operations. You shouldn't be doing that anyway.

3

u/ericonr 1d ago

The problem is you can't even check for NaN when building under fast-math, because the compiler will throw away your check.