title: Setting Max value for Complex Double to replace Infinity
body: <p>I am writing a C++ code that contains an Array of complex doubles. After some matrix operations Real and imaginary parts of some of the array entities goes to +/- Infinity. I want to set a maximum for doubles such that every time the value is exceeded, the defined max possible value of double is used.
  Is there an easy way to do it other than checking values of the array every time?</p>
  
  <p>Thank You.</p>