Quick question about "print EXPR"

Brian Desany brian@desany.com
Wed Dec 22 20:25:00 GMT 2004


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 



More information about the Gdb mailing list