gdb
[Top][All Lists]
Advanced

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

Why "call cos(.2)" returns garbage?


From: pilgrim2
Subject: Why "call cos(.2)" returns garbage?
Date: Wed, 23 Dec 2009 17:17:01 -0800 (PST)

Hi, 

  I was wondering how come the call to "call cos(.2)" returns the wrong
answer in:

#include <math.h>
double    (*fcn)(double);
main() 
{
  double t;
  fcn = cos;
  t=cos(.2);
  t=cos(-.2);
}

(gdb) call cos(.2)
$16 = 104
(gdb) call fcn(.2)
$17 = 0.98006657784124163

Thanks,

Linh
-- 
View this message in context: 
http://old.nabble.com/Why-%22call-cos%28.2%29%22-returns-garbage--tp26909516p26909516.html
Sent from the Gnu - gdb - General mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]