comp.lang.ada
 help / color / mirror / Atom feed
* -ve values in enumeration rep clauses.
@ 1996-06-14  0:00 Darel Cullen
  1996-06-14  0:00 ` James Rhodes
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Darel Cullen @ 1996-06-14  0:00 UTC (permalink / raw)



Hi,
   Came across an interesting problem at work today.

What happens if for example :-

type A_Type is 
        ( A, B, C );

for A_Type use
        (       
          A => -1,
          B => -2,
          C => -3
        );

for A_Type'Size use 8;

Now - to be able to extract the -ve values via unchecked_conversion
from a byte proves impossible because the use 8 creates an unsigned
byte, so whats the best way to represent negative values from a
rep-claused enumerated type ?

-- 
Darel Cullen




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

end of thread, other threads:[~1996-06-15  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-14  0:00 -ve values in enumeration rep clauses Darel Cullen
1996-06-14  0:00 ` James Rhodes
1996-06-15  0:00   ` Robert Dewar
1996-06-14  0:00 ` Adam Beneschan
1996-06-14  0:00 ` Pascal Ledru

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