comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <mcondic.nospam@acm.org>
To: Anthony Busigin <abusigin@nitek.com>
Subject: Re: Size of Float
Date: 2000/09/28
Date: 2000-09-28T13:49:33+00:00	[thread overview]
Message-ID: <39D34C66.12801E1F@acm.org> (raw)
In-Reply-To: 39D2C182.B1CCE75D@nitek.com

Anthony Busigin wrote:

> Long_Long_Float on Intel chips is 80 bits - not 96 bits.

Try running the following after compiling it on a PC with GNAT 3.13p:

with Ada.Text_IO ;
use  Ada.Text_IO ;
procedure How_Big_Is_Long_Long_Float is
begin
    --
    Put_Line ("Standard.Long_Long_Float'Size:       " &
        Integer'Image (Long_Long_Float'Size)) ;
    Put_Line ("Standard.Long_Long_Float'Digits:     " &
        Integer'Image (Long_Long_Float'Digits)) ;
    --
end How_Big_Is_Long_Long_Float ;

On my machine, the output looks like this:

Standard.Long_Long_Float'Size:        96
Standard.Long_Long_Float'Digits:      18

Granted, the underlying floating point processor hardware may use only 80 of
the 96 bits. The storage size however, is going to be 96 - probably to make
things fall on longword boundaries.

I guess it all depends on what the meaning of the word "size" is? :-)

MDC
--
======================================================================
Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/
Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m
Visit my web site at:  http://www.mcondic.com/

    "Giving money and power to Government is like giving whiskey
    and car keys to teenage boys."

        --   P. J. O'Rourke
======================================================================






      reply	other threads:[~2000-09-28  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-26  0:00 Size of Float Daniel Allex
2000-09-26  0:00 ` Larry Kilgallen
2000-09-27  0:00 ` Marin David Condic
2000-09-27  0:00   ` Anthony Busigin
2000-09-28  0:00     ` Marin David Condic [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox