From 6.3.1.5 of the C99 standard:
Wiki Markup If a {{double}} is demoted to a {{float}} or a {{long double}} is demoted to a {{double}} or a {{float}}, ...\[and\] the value being converted is outside the range of values that can be represented, the behavior is undefined.
Non-Compliant Code Example
...