Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: <tromey@redhat.com>
Cc: "'Eli Zaretskii'" <eliz@gnu.org>, 	<gdb-patches@sourceware.org>
Subject: RE: [RFA] Handle BINOP_INTDIV in valarith.c
Date: Wed, 23 Jan 2008 23:00:00 -0000	[thread overview]
Message-ID: <001c01c85e13$a123d9d0$e36b8d70$@u-strasbg.fr> (raw)
In-Reply-To: <m37ii0tmx9.fsf@fleche.redhat.com>



> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Tom Tromey
> Sent: Wednesday, January 23, 2008 7:30 PM
> To: Pierre Muller
> Cc: 'Eli Zaretskii'; gdb-patches@sourceware.org
> Subject: Re: [RFA] Handle BINOP_INTDIV in valarith.c
> 
> >>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:
> 
> Pierre>   This is the right thing to do for pascal,
> Pierre> but I don't know about the other languages:
> Pierre> do fortran, Ada, Modula-2 or java
> Pierre> allow 'a / b' for a or b of integer types?
> 
> For Java the normal binary promotion rules apply to '/'.
> 
> That is: if either a or b is double, the other is promoted to double.
> Then likewise for float.
Currently gdb does promotion to doubles
if one of the two is TYPE_CODE_FLT (i.e. any type of floating point,
except maybe the decimal floating that was recently introduced and
which code I did not look into yet).

> Then likewise for long.
> And finally, if none of those apply, both are promoted to int.
> 
> So IOW, yes :)

 But this means that like C and unlike pascal
'35 / 2' returns a integer of value 17, while for pascal
it does return a real of value 17.5.

 
> There are also special rules about certain integer divisions.
> Division by zero throws an exception, and MIN_INT/-1 is defined to be
> MIN_INT.
You probably ment MAX_INT here, no? 
> In Java 5 there is also unboxing, but we never updated gdb to know
> about that.
I almost never used Java, so I have no idea what unboxing means...

Pierre Muller




  reply	other threads:[~2008-01-23 23:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-16 14:14 Pierre Muller
2008-01-16 19:11 ` Eli Zaretskii
2008-01-21 10:45   ` Pierre Muller
2008-01-23 18:25     ` Joel Brobecker
2008-01-23 22:36       ` Pierre Muller
2008-01-23 23:09         ` Joel Brobecker
2008-01-23 23:55           ` Pierre Muller
2008-01-24  1:30             ` Joel Brobecker
2008-01-23 19:07     ` Tom Tromey
2008-01-23 23:00       ` Pierre Muller [this message]
2008-01-24  0:27         ` Tom Tromey
2008-01-17 11:58 ` Joel Brobecker
2008-01-17 12:04   ` Joel Brobecker
2008-01-18 16:27     ` Eli Zaretskii
2008-01-21 15:04       ` Pierre Muller
2008-01-25 13:07       ` [RFA] Handle BINOP_INTDIV in eval.c Pierre Muller
2008-01-30  1:01         ` Daniel Jacobowitz
2008-01-30  7:35           ` Pierre Muller

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='001c01c85e13$a123d9d0$e36b8d70$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@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