Search code examples
cgccmingwprintfinfinity

infinity and nan values


I use gcc-mingw,4.5.2 on Winows 7. printf of infinity and nan values causes 1.#INF00 and -1.#IND00 to appear in the screen ,instead of infinity && nan what could be a solution for this problem

UPD:I tried to use isinf and isnan macros :

C3861: 'isinf': identifier not found error 
C3861: 'isnan': identifier not found.

(I did include to math.h) What is the reason for this?


Solution

  • Use the isinf() and isnan() macros to test wheter a number is an infinite or a NaN.