Checking for NaN
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Checking for NaN
Again, thanks for taking a look and helping me correct it, sorry I get a little dense sometimes.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: Checking for NaN
Doing 0/0 should work.albinopapa wrote: ↑August 28th, 2020, 7:00 pmAside from std::nan() and the std::numeric_limits functions, how would you even getting a nan as a result? I tried dividing by 0.0 and end up getting inf.
Code: Select all
double zero = 0.0f;
x.f = zero / zero;
Glad you got it working in the end