floooh / sokol

minimal cross-platform standalone C headers
https://floooh.github.io/sokol-html5
zlib License
6.54k stars 469 forks source link

Check isnan Width and Height #987

Closed kassane closed 5 months ago

kassane commented 5 months ago

based on D bindings: https://github.com/kassane/sokol-d/issues/5#issuecomment-1921244802

cc: @floooh

floooh commented 5 months ago

Makes sense, yeah. I'll wait for the CI tests to go green (because I only see isnan() as C99 feature and wonder if C++ knows it too...

Do you know how those values became NaNs in the first place? If it's already mentioned in the thread just point me to the right comment :)

floooh commented 5 months ago

to the fact that the float/double in D is nan instead of 0.0f by default.

...wait does that mean that an unitialized float/double in D is initialized as NaN? That would be quite crazy because NaNs have a tendency to spread (they turn every expression result into NaNs too).

floooh commented 5 months ago

Ok all green and merged. Thanks!