[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[LCP]Detecting overflow of floating point calculations



What's the best way to detect overflow during floating point calculations?
I know that I know that if a floating point number is larger than the
maximum value it can hold, the printf() family of functions will print
"inf", at least with gcc, so printing to a string with sprintf() and then
testing the result would work, but is it portable?  And is there a better
way?  It seems to me that there ought to be  Thanks.

Chuck