upvote
On my machine it detects overflows just fine, returning Inf and -Inf, and also correctly rounds underflows to 0 and -0. But the function itself still returns 1 for overflows/underflows, so it's up to the caller to filter out infinities.

I guess that backs up the complaint about portability, if sscanf() doesn't behave that way on all platforms. But on MSVC its behavior is reasonable enough.

reply