This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

tanh is an odd function



The following test case fails on i386 with libc-2.2.3.  Fix is below.

----
long double tanhl (long double);

int
main()
{
  long double x, y, ny;

  x = -1.0;
  ny = tanhl (x);
  y = tanhl (-x);
  if (y == ny)
    abort ();
  exit (0);
}
----

	* sysdeps/ieee754/ldbl-96/s_tanhl.c (__tanhl): Fix sign test.

*** s_tanhl.c	1999/07/14 00:15:23	1.1
--- s_tanhl.c	2001/05/14 00:11:15
***************
*** 90,95 ****
  	} else {
  	    z = one - tiny;		/* raised inexact flag */
  	}
! 	return (se>0x7fff)? -z: z;
  }
  weak_alias (__tanhl, tanhl)
--- 90,95 ----
  	} else {
  	    z = one - tiny;		/* raised inexact flag */
  	}
! 	return (se&0x8000)? -z: z;
  }
  weak_alias (__tanhl, tanhl)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]