Re: tan(pi/2) overflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2011-04-08 20:10:13 -0400, richardcavell@xxxxxxxx wrote:
> 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.

IIRC, this cannot happen for single and double precision (the proof
consists in finding the worst cases, using continued fractions). I
don't know whether this has also been proved for the x87 extended
precision.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux