OT: Leaving Rust gamedev after 3 years
Hipreme
msnmancini at hotmail.com
Tue Apr 30 01:56:37 UTC 2024
On Monday, 29 April 2024 at 19:22:54 UTC, claptrap wrote:
> On Monday, 29 April 2024 at 12:04:00 UTC, Bruce Carneal wrote:
>> [...]
>
> If you're converting float to int, which is essentially all the
> time for a software rendering, then NaNs usually end up as
> 0xFFFFFFFF, which is no better than zero.
>
> And you literally dont want to litter the fast path with NaN
> checks. You probably could do with asserts but it'd be far more
> useful to just get a compiler error on uninitialised floats.
>
> I mean if the whole argument is default init to NaN helps catch
> uninitialized variables, there's a far more effective solution.
> That would **actually** be useful.
>
> Default init to NaN is not useful, its not worse than zero, but
> it's not better. And you might actual want to init to zero
> sometimes.
My main problem against NaN is that it puts NaN on registers
instead of checking and throwing.
More information about the Digitalmars-d
mailing list