Quick question about "print EXPR"

Brian Desany
2004-12-22T20:25:53Z

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.