comp.lang.ada
 help / color / mirror / Atom feed
From: elroy.jpl.nasa.gov!sdd.hp.com!mips!zaphod.mps.ohio-state.edu!unix.cis.pit t.edu!dsinc!gvlf3.gvl.unisys.com!email!parkhill@ames.arc.nasa.gov  (parkhill)
Subject: Re: 'SIZE attribute of a type
Date: 13 Nov 91 17:01:01 GMT	[thread overview]
Message-ID: <5830@email.sp.unisys.com> (raw)

gardner@tsd.arlut.utexas.edu (Donald Gardner) writes:
> 
> The 'SIZE attribute (for a type) is defined in LRM 13.7.2(5) as 
> 
> 	"...the minimum number of bits that is needed by the implementation
> 	to hold any possible object of this type...".  
> 
> Code from the compiler I am using returns the value 8 
> for CHARACTER'SIZE.  I was expecting a value of 7.  Which is 
> correct?  
> 
> If 8 is the correct value, is there way to obtain
> the value I want that is simpler than taking the log base 2 of
> CHARACTER'POS (CHARACTER'LAST)?

The value of 8 is correct. Why were you expecting 7? Were you applying
'SIZE to a subtype of CHARACTER? When you read "minimum number of bits
that is needed by the implementation" this means the minimum amount of
space used by the compiler. It does NOT mean the smallest amount of 
space that could possibly be used to implement the type. This is 
demonstrated when you do a Boolean'SIZE and get 8.  It is possible for
the compiler to use 1 bit but it instead uses 8.

Why not just "return 7;" if you want 7? You might want to explain the
problem more fully.

Robert Parkhill

             reply	other threads:[~1991-11-13 17:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-11-13 17:01 elroy.jpl.nasa.gov!sdd.hp.com!mips!zaphod.mps.ohio-state.edu!unix.cis.pit [this message]
  -- strict thread matches above, loose matches on Subject: below --
1991-11-14 16:45 'SIZE attribute of a type Danford Lehman
1991-11-14 19:58 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!mips!pacbell.com!iggy.GW.Vit
1991-11-14 20:15 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!mips!pacbell.com!iggy.GW.Vit
1991-12-06 18:50 Brian Hanafee
1991-12-06 20:04 parkhill
1991-12-06 20:15 parkhill
1991-12-06 21:07 Richard Pattis
1991-12-06 21:14 Ed Matthews
1991-12-07  0:32 Donald Gardner
1991-12-09 13:24 Ed Matthews
1991-12-10  8:23 paul goffin
1991-12-10 12:30 mcsun!uknet!yorkohm!minster!mjl-b
1991-12-11 18:29 elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!gv
1991-12-12  3:17 Mark Biggar
1991-12-12 15:18 elroy.jpl.nasa.gov!swrinde!mips!samsung!caen!umeecs!dip.eecs.umich.edu!wa
1991-12-12 15:36 elroy.jpl.nasa.gov!sdd.hp.com!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu
1991-12-12 22:49 Robert I. Eachus
1991-12-13 15:23 agate!spool.mu.edu!yale.edu!qt.cs.utexas.edu!zaphod.mps.ohio-state.edu!ca
1991-12-13 16:00 Alex Blakemore
1991-12-13 17:24 elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!ds
replies disabled

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