OT: Leaving Rust gamedev after 3 years
Bruce Carneal
bcarneal at gmail.com
Mon Apr 29 03:51:09 UTC 2024
On Monday, 29 April 2024 at 01:44:20 UTC, monkyyy wrote:
> On Monday, 29 April 2024 at 00:55:54 UTC, Walter Bright wrote:
>> On 4/26/2024 4:14 PM, Matheus Catarino wrote:
>>> I'm not a game developer, but when it comes to graphics
>>> programming dealing with floating point, NaN will be a
>>> problem that not everyone has experience or patience in
>>> dealing with.
>>
>> When a NaN shows up unexpectedly in the results, it's
>> indicative of a bug in the program.
>
> nans dont show up when programming video games they end in
> silently failed draw calls
If they're silent how do you know they failed? Also, if you *do*
know they failed why would NaN be unhelpful in localizing the
problem? It could be initialization, or it could be something
else along the way.
Zero initialization has a few things to recommend it over NaN
(consistency with our non-FP types, zero is often (not always)
the correct initialization value anyway, aligns with zero fill
new-page machinery, simpler if you write bug free code :-) ...).
OTOH, NaNs can be very helpful when trying to track down FP
problems, with improper (unthinking) initialization probably near
the top of the list.
More information about the Digitalmars-d
mailing list