From a072c1dc88025ce36b7eb3563ed6d3f072ab3dba Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Sun, 3 Aug 2008 08:36:51 +0000 Subject: [PATCH] Hack to avoid the problem of tanf(PI/4) overflowing in GLIBC. --- src/c/num_sfun.d | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/c/num_sfun.d b/src/c/num_sfun.d index 1c9cdaaab..98ab176e8 100644 --- a/src/c/num_sfun.d +++ b/src/c/num_sfun.d @@ -597,6 +597,18 @@ cl_cos(cl_object x) @(return output) } +/* + * As of 2006-10-13 I found this bug in GLIBC's tanf, which overflows + * when the argument is pi/4. It is 2008 and this has not yet been + * solved. + */ +#if defined(__amd64__) && defined(__GLIBC_) +# ifdef tanf +# undef tanf +# endif +# define tanf(x) (float)tan(x) +#endif + cl_object cl_tan(cl_object x) {