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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,7e15102eb14c0020 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.223.84 with SMTP id ij20mr6940679qab.5.1349426298507; Fri, 05 Oct 2012 01:38:18 -0700 (PDT) Received: by 10.52.29.174 with SMTP id l14mr1507990vdh.13.1349426298482; Fri, 05 Oct 2012 01:38:18 -0700 (PDT) Path: e10ni165558057qan.0!nntp.google.com!l8no26212572qao.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 5 Oct 2012 01:38:18 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=188.66.211.138; posting-account=g6PEmwoAAADhFsmVm6Epjviaw4MLU0b5 NNTP-Posting-Host: 188.66.211.138 References: <50673111$0$9505$9b4e6d93@newsspool1.arcor-online.net> <38594cbf-b52d-4002-8db9-410f55126a09@googlegroups.com> <50694f43$0$6577$9b4e6d93@newsspool3.arcor-online.net> <036db9eb-36e8-4a2e-8832-cecd9f1f4e2d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0340c7e7-4181-405e-9d1f-b5989818065b@googlegroups.com> Subject: Re: highest bit, statically determined From: Anatoly Chernyshev Injection-Date: Fri, 05 Oct 2012 08:38:18 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-10-05T01:38:18-07:00 List-Id: > If you play with the memory optimization (I'm not very good at it), the a= rray above will be made of 3 bit integers (0 to 7), which occupy lousy 3*25= 6/8=3D 96 bytes of memory. Laughable by today's standards. Even if you go f= or long_long_long..._integers, the table will be quite small. Here we go: with Text_IO; use Text_IO; procedure xx is type smallint is range 0..7; type smallint_a is array(0..255) of smallint; for smallint_a'Component_Size use 3; last_bit_a: smallint_a:=3D(0|1=3D>0,2|3=3D>1,4..7=3D>2, 8..15=3D>3, 16..31= =3D>4,32..63=3D>5, 64..127=3D>6, 128..255=3D>7); begin put_line (integer'Image (smallint_a'size/8)); end xx;=20