1/28/2014

(OpenCV Study) -1.#IND, check by cvIsNaN

-1.#IND is generated when sqrt(-1),
IND is abstract of "indeterminate"

To check this value, we can use cvIsNaN function
The function check the input value is indeterminate value or not.
If value is indeterminate value, the function return 1


show the example code

printf ("cvIsNaN (0.0) : %d\n",cvIsNaN (0.0));
printf ("cvIsNaN (1.0/0.0) : %d\n",cvIsNaN (1.0/0.0));
printf ("cvIsNaN (-1.0/0.0) : %d\n",cvIsNaN (-1.0/0.0));
printf ("cvIsNaN (sqrt(-1.0)): %d\n",cvIsNaN (sqrt(-1.0)));

output is
cvIsNaN (0.0)      : 0
cvIsNaN (1.0/0.0)  : 0
cvIsNaN (-1.0/0.0) : 0
cvIsNaN (sqrt(-1.0): 1


No comments:

Post a Comment