This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Quick question about "print EXPR"
- From: Brian Desany <brian at desany dot com>
- To: gdb at sources dot redhat dot com
- Date: Wed, 22 Dec 2004 12:25:44 -0800 (PST)
- Subject: Quick question about "print EXPR"
I read in the docs that "print EXPR" should work with function calls.
Why is it that no matter what argument I pass to "print floor(234.567)", I always get an answer of
"1"?
...
7 yada = 2.5;
(gdb) n
8 haha = floor(yada);
(gdb)
9 printf("%0.1f %0.1f\n",yada, haha);
(gdb) p yada
$1 = 2.5
(gdb) p haha
$2 = 2
(gdb) p floor(yada)
$3 = 1
(gdb) l
4 int main(int argc, char *argv[]) {
5 double yada;
6 double haha;
7 yada = 2.5;
8 haha = floor(yada);
9 printf("%0.1f %0.1f\n",yada, haha);
10 return 0;
11 }
...
Thanks-
-Brian.
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail