Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Brian Desany <brian@desany.com>
To: gdb@sources.redhat.com
Subject: Quick question about "print EXPR"
Date: Wed, 22 Dec 2004 20:25:00 -0000	[thread overview]
Message-ID: <20041222202544.64087.qmail@web51002.mail.yahoo.com> (raw)
In-Reply-To: <1103746608.31531.ezmlm@sources.redhat.com>

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 


       reply	other threads:[~2004-12-22 20:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1103746608.31531.ezmlm@sources.redhat.com>
2004-12-22 20:25 ` Brian Desany [this message]
2004-12-22 20:40   ` Peter Barada
2004-12-22 20:47     ` Brian Desany
2005-01-04 20:26       ` Andrew Cagney
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
2005-01-04 23:06         ` Brian Desany
     [not found] <E1ClxlM-0003ME-7B@monty-python.gnu.org>
2005-02-08 16:42 ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041222202544.64087.qmail@web51002.mail.yahoo.com \
    --to=brian@desany.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox