comp.lang.ada
 help / color / mirror / Atom feed
* Re: Size of Float
  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
  1 sibling, 0 replies; 5+ messages in thread
From: Larry Kilgallen @ 2000-09-26  0:00 UTC (permalink / raw)


In article <39D13A5C.9A587A82@erols.com>, Daniel Allex <dallex@erols.com> writes:
> Is a float limited to 32 bits or is there a 64 bit version?  I'm using
> Ada95.

Such things depend on your compiler and the underlying computer.

It is against the spirit of Ada for the standard to limit compilers
from providing support for large values of a type (except for Boolean).




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Size of Float
@ 2000-09-26  0:00 Daniel Allex
  2000-09-26  0:00 ` Larry Kilgallen
  2000-09-27  0:00 ` Marin David Condic
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Allex @ 2000-09-26  0:00 UTC (permalink / raw)


Is a float limited to 32 bits or is there a 64 bit version?  I'm using
Ada95.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Size of Float
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Marin David Condic @ 2000-09-27  0:00 UTC (permalink / raw)


Daniel Allex wrote:

> Is a float limited to 32 bits or is there a 64 bit version?  I'm using
> Ada95.

The language doesn't limit the size of floating point types. What sizes
are available is going to depend on your compiler and platform. For
example, I'm using the GNAT cmpiler on a PC platform and this supports a
built-in type called Long_Long_Float which is 96 bits. Whereas the GNAT
compiler on an Alpha/VMS platform will only support 64 bits. The maximum
size is usually dictated by the underlying hardware.

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
======================================================================






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Size of Float
  2000-09-27  0:00 ` Marin David Condic
@ 2000-09-27  0:00   ` Anthony Busigin
  2000-09-28  0:00     ` Marin David Condic
  0 siblings, 1 reply; 5+ messages in thread
From: Anthony Busigin @ 2000-09-27  0:00 UTC (permalink / raw)
  To: Marin David Condic

Marin David Condic wrote:

> ... I'm using the GNAT cmpiler on a PC platform and this supports a
> built-in type called Long_Long_Float which is 96 bits. Whereas the GNAT
> compiler on an Alpha/VMS platform will only support 64 bits. The maximum
> size is usually dictated by the underlying hardware.

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

Anthony Busigin
abusigin@nitek.com






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Size of Float
  2000-09-27  0:00   ` Anthony Busigin
@ 2000-09-28  0:00     ` Marin David Condic
  0 siblings, 0 replies; 5+ messages in thread
From: Marin David Condic @ 2000-09-28  0:00 UTC (permalink / raw)
  To: Anthony Busigin

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
======================================================================






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-09-28  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox