o imprecise (inexact) result, and When a floating-point exception occurs, the corresponding sticky bit is set (1), and if the mask bit is enabled (1), the trap takes place. These routines let the user change the behavior on occurrence of any of these exceptions, as well as change the rounding mode for floating-point operations.

> Hello

> Does anyone know how to detect for int/float/double overflow and > underflow in c++ (without resort to using a larger representation)?

However : "The C++ programming language defines the action taken on underflow or overflow to be machine-dependent, which means it is up to to compiler and the target computer to determine how to handle overflow and underflow. Most C++ compilers leave the detection up to the programmer--that is, the compiler acts as though underflow and overflow never occur. This approach makes sense from a perspective of efficiency; if code has to be generated to check for underflow or overflow whenever an arithmetic operation is performed, then programs would not only be larger, they would run more slowly, a very undesirable situation given that arithmetic overflow seldom occurs in programs that work with numbers well within the defined range for integers." -- Michael DOUBEZ

> Does anyone know how to detect for int/float/double overflow and > underflow in c++ (without resort to using a larger representation)?

In general int's do not generate under-/overflow errors, although on some CPUs it is possible to set options that will do so. If you need to know, you have to check the int value yourself. Floating point is also platform dependent. If the platform confoorms to IEEE floating point standards, you are supposed to get exceptions for a variety of problems: divide by zero, invalid format, under-/overflow, not-a-number (nan), etc. These are normally signals raised by the system, not something that is C++.