opensubscriber
   Find in this group all groups
 
Unknown more information…

g : gdb@gnu.org 24 December 2009 • 9:17AM -0500

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

REPLY TO AUTHOR
 
REPLY TO GROUP





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.




Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.