Does any standard specifies what should be the output?
For example this code:
#include
#include
int main(int argc, ch
As Paul said, it's undefined:
From §6.3.1.4:
6.3.1.4 Real floating and integer
When a finite value of real floating type is converted to an integer type other than _Bool, the fractional part is discarded (i.e., the value is truncated toward zero). If the value of the integral part cannot be represented by the integer type, the behavior is undefined.50)
Infinity isn't finite, and the integral part can't be represented in an integral type, so it's undefined.