From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7dac35d19d7d0d84 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-14 13:05:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!71102-cm.able.ES!not-for-mail From: Jano <402450@cepsz.unizar.es> Newsgroups: comp.lang.ada Subject: Re: Getting modular type size in bits Date: Fri, 14 Mar 2003 22:05:33 +0100 Message-ID: References: NNTP-Posting-Host: 71102-cm.able.es (212.97.171.102) X-Trace: fu-berlin.de 1047675934 70504149 212.97.171.102 (16 [49872]) X-Newsreader: MicroPlanet Gravity v2.50 Xref: archiver1.google.com comp.lang.ada:35344 Date: 2003-03-14T22:05:33+01:00 List-Id: Robert A Duff (bobduff@shell01.TheWorld.com) dice... > Jano <402450@cepsz.unizar.es> writes: > > > type Number is Mod 2**32; > > > > I want to know that the type size is 5. I'm aware of the 'modulus > > attribute, and 'size. If I understand correctly, 'size returns the size > > allocated by the compiler for the type (normally 8 in this case), not > > the _minimum_ size to allocate it (which is what I would need in that > > case). > > 'Size returns the minimum -- i.e. how big it would be if it were a > component of a packed record. That's 32 in this case. If it were > "mod 2**5", then Number'Size would be 5, not 8. Sorry about the typo. Really, the declaration should be, as you correctly note, type Number is mod 2 ** 5; Argh, and testing now 'size, I see it returns 5. Mind you, to that I was refering with "silly thing". Because I tested it previously and made the same mistake, using the modulus in place of the size!!!!!! Silly me, silly me, silly me... now I should be happy because my problem is solved :) but anyways... In regard to Lutz post, is fine for me to obtain size 8 if you force the size explicitely. Many thanks, -- ------------------------- Jano 402450[at]cepsz.unizar.es -------------------------