[Example 1: #include<limits>int main(){// Assuming 32-bit int, 32-bit float and 64-bit double.double d2 = std::numeric_limits<double>::max();
float f = d2; // undefined behavior on systems where the range of representable values// of float is [-max,+max]; on systems where the range of representable// values is [-inf,+inf] this would not be undefined behaviorint i = d2; // undefined behavior, the max value of double is not representable as int} — end example]