I have a piece of Javascript code and i am trying to convert it into C code. I have a problem to convert following line to C:
var q = (!isNaN(dLat/dPhi)) ? dLat/dPhi : Math.cos(lat1);
Can you tell me equivalent of isNan in C?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
On first sight, it looks like the original author just wanted to check for
dPhibeing 0, so you might want to substitute that. However, if you want to translate the code verbatim, simply use theisnanmacro from math.h, like this: