Thanks to you both. I also was thinking that M_PI/2 wasn't close enough to the mathematical value to produce the overflow exception. Thanks. 2011/4/8 <richardcavell@xxxxxxxx>: >> "Mathematically, the tangent function has singularities at odd > > multiples >> >> of pi/2. If the argument x is too close to one of these singularities, >> tan will signal overflow." > > Since pi is irrational, pi/2 is also irrational and therefore infinitely > long when represented in any base. It is impossible to represent pi/2 in > any floating point number format. Therefore, it's impossible to pass pi/2 > into tan() and impossible to hit a singularity. You might like to feed it > values that are very close to see whether you can make the result overflow. > > > >