Is there any way I can get rqrtf(0.0) to return a NaN instead of an inf so I can use fmaxf and fminf to weed out the invalid results? This is what I want to do in a nutshell:
d = dxdx+dydy+dzdz;
d=rsqrtf(d);
if(d is inf) d=0;
result+=dmultfact;
If rqsrtf returned a NaN, from what I read from the programming manual, I could fmaxf(0.0,d) it to get rid of the divergent if statement. Sadly, it doesn’t work in case of an inf.
Thanks
EDIT: I just realized NaNs are not supposed to be the result of division by zero, but any help with getting rid of the divergent if will be appreciated nonetheless