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]
Other format: [Raw text]

incorrect result from cos on non-x86 platform


A Debian user reported that running this program on PowerPC or ARM,
using glibc 2.3.1:

#include <stdio.h>
#include <math.h>

int main (void)
{
  double x, y;
  x = 0.80190127184058835;
  y = cos (x);
  printf ("cos(%.17g) = %.17g\n", x, y);
  y = sin (x);
  printf ("sin(%.17g) = %.17g\n", x, y);
  return 0;
}

prints

cos(0.80190127184058835) = 0.71867942238767868
sin(0.80190127184058835) = 0.71867942238767868

rather than the expected results of

cos(0.80190127184058835) = 0.69534156199418473
sin(0.80190127184058835) = 0.71867942238767868

p.


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