From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17420 invoked by alias); 2 Jun 2002 00:01:07 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 17406 invoked from network); 2 Jun 2002 00:01:04 -0000 Received: from unknown (HELO localhost.localdomain) (146.225.1.61) by sources.redhat.com with SMTP; 2 Jun 2002 00:01:04 -0000 Received: (from jbuck@localhost) by localhost.localdomain (8.11.6/8.11.6) id g5208k429777; Sat, 1 Jun 2002 17:08:46 -0700 From: Joe Buck Message-Id: <200206020008.g5208k429777@localhost.localdomain> Subject: Re: vax double precision broken To: pkoning@equallogic.com (Paul Koning) Date: Sat, 01 Jun 2002 17:01:00 -0000 Cc: gcc@gcc.gnu.org In-Reply-To: from "Paul Koning" at Jun 01, 2002 03:36:38 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-06/txt/msg00007.txt.bz2 > The single and double IEEE formats do indeed look similar to VAX F and > G formats respectively, but they do NOT match. There are three key > differences: the halfwords are in the opposite order (sign bit is bit > 31 in each case for IEEE); the exponent bias is one less -- 127 and > 1023 for IEEE vs. 128 and 1024 for VAX; and the hidden high order bit > is interpreted as the bit just to the left of the binary point (2**0) > in IEEE rather than just to the right (2**-1) as in VAX. (In > addition, IEEE has both Inf and NaN, while DEC format only has NaN. > And IEEE has denormals; DEC does not.) There's a 4th difference: F-floating has the same exponent size as IEEE single precision, but D-floating has the same number of exponent bits as F-floating while IEEE doubles have more exponent bits. (Conversion from Vax-D to Vax-F is a simple matter of rounding off the mantissa, while for IEEE, overflow can occur because the double precision type has greater range).