1 2 3 4 5
void checkInfinity(float value) { if (std::isinf(value)) { throw std::overflow_error("Value is infinity"); } }