From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 115914,eb58654c5683eea0 X-Google-Attributes: gid115914,public X-Google-Thread: 10cebf,eb58654c5683eea0 X-Google-Attributes: gid10cebf,public X-Google-Thread: 1164f8,eb58654c5683eea0 X-Google-Attributes: gid1164f8,public From: lionel@mail.dec.com (Steve Lionel) Subject: Re: VAX D-Float format Date: 1997/10/30 Message-ID: <63aalh$7rj@usenet.pa.dec.com>#1/1 X-Deja-AN: 285991582 Distribution: world Sender: lionel@quark (Steve Lionel) References: <34575f82.182344367@serve.installshield.com> Organization: Digital Equipment Corporation, Nashua NH Reply-To: lionel@mail.dec.com (Steve Lionel) Newsgroups: comp.sys.dec,comp.sys.dec.micro,comp.arch.arithmetic In article <34575f82.182344367@serve.installshield.com>, chiehcheng@geocities.com (Chieh Cheng) writes: |>I am trying to decode and decipher Intergraph Microstation's Design |>file format. It uses the VAX D-Float format. Although it is also 64 |>bit long, it is somewhat different from the IEEE double float format. Here's the description of VAX floating formats from the OpenVMS FAQ: VAX2. What is the layout of the VAX floating point format? The VAX floating point format is derived from one of the PDP-11 FP formats, which helps explain its strange layout. There are four formats defined: F 32-bit single-precision, D and G 64-bit double-precision and H 128-bit quadruple precision. For all formats, the lowest addressed 16-bit "word" contains the sign and exponent (and for other than H, some of the most significant fraction bits). Each successive higher-addressed word contains the next 16 lesser-significant fraction bits. Bit 15 of the first word is the sign, 1 for negative, 0 for positive. Zero is represented by a biased exponent value of zero and a sign of zero; the fraction bits are ignored (but on Alpha, non-zero fraction bits in a zero value cause an error.) A value with biased exponent zero and sign bit 1 is a "reserved operand" - touching it causes an error - fraction bits are ignored. There are no minus zero, infinity, denormalized or NaN values. For all formats, the fraction is normalized and the radix point assumed to be to the left of the MSB, hence 0.5 <= f < 1.0. The MSB, always being 1, is not stored. The binary exponent is stored with a bias varying with type in bits 14:n of the lowest-addressed word. Type Exponent bits Exponent bias Fraction bits (including hidden) ========================================================================== F 8 128 24 D 8 128 56 G 11 1024 53 H 15 16384 113 The layout for D is identical to that for F except for 32 additional fraction bits. Example: +1.5 in F float is hex 000040C0 (fraction of .11[base 2], biased exponent of 129) -- Steve Lionel mailto:Steve.Lionel@digital.com Fortran Development http://www.digital.com/info/slionel.html Digital Equipment Corporation 110 Spit Brook Road, ZKO2-3/N30 Nashua, NH 03062-2698 "Free advice is worth every cent" For information on DIGITAL Fortran, see http://www.digital.com/fortran