From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14707 invoked by alias); 23 Jan 2008 19:07:33 -0000 Received: (qmail 14601 invoked by uid 22791); 23 Jan 2008 19:07:33 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 23 Jan 2008 19:07:15 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m0NJ71Pb015829; Wed, 23 Jan 2008 14:07:01 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m0NJ70ln031433; Wed, 23 Jan 2008 14:07:00 -0500 Received: from opsy.redhat.com (ton.yyz.redhat.com [10.15.16.15]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m0NJ704n031249; Wed, 23 Jan 2008 14:07:00 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 1C9D9378324; Wed, 23 Jan 2008 11:30:11 -0700 (MST) To: "Pierre Muller" Cc: "'Eli Zaretskii'" , Subject: Re: [RFA] Handle BINOP_INTDIV in valarith.c References: <002d01c85849$ef420f80$cdc62e80$@u-strasbg.fr> <002401c85c1a$b1997b30$14cc7190$@u-strasbg.fr> From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Wed, 23 Jan 2008 19:07:00 -0000 In-Reply-To: <002401c85c1a$b1997b30$14cc7190$@u-strasbg.fr> (Pierre Muller's message of "Mon\, 21 Jan 2008 11\:45\:09 +0100") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.990 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00559.txt.bz2 >>>>> "Pierre" == Pierre Muller 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. Then likewise for long. And finally, if none of those apply, both are promoted to int. So IOW, yes :) 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. In Java 5 there is also unboxing, but we never updated gdb to know about that. Tom