3 ms·
For game programming, it is decidedly better to produce subtly incorrect results, at least on a release build, than NaN everywhere.
by TheLoneWolfling 11y ago
For game programming, it is decidedly better to produce subtly incorrect results, at least on a release build, than NaN everywhere.
- yoklov 11y agoIn game programming you want it to be 0 as often as you want it to be 1 (or really, less often). Just write a safeDiv function that takes an argument for what the result should be if the denominator is zero.