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: 103376,7e15102eb14c0020 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.87.161 with SMTP id az1mr4070578pab.38.1349019581375; Sun, 30 Sep 2012 08:39:41 -0700 (PDT) Received: by 10.68.204.134 with SMTP id ky6mr3513703pbc.1.1349019581320; Sun, 30 Sep 2012 08:39:41 -0700 (PDT) Path: t10ni23592188pbh.0!nntp.google.com!kt20no4481050pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 30 Sep 2012 08:39:41 -0700 (PDT) In-Reply-To: <50673111$0$9505$9b4e6d93@newsspool1.arcor-online.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=188.66.236.8; posting-account=g6PEmwoAAADhFsmVm6Epjviaw4MLU0b5 NNTP-Posting-Host: 188.66.236.8 References: <50673111$0$9505$9b4e6d93@newsspool1.arcor-online.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <38594cbf-b52d-4002-8db9-410f55126a09@googlegroups.com> Subject: Re: highest bit, statically determined From: Anatoly Chernyshev Injection-Date: Sun, 30 Sep 2012 15:39:41 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-09-30T08:39:41-07:00 List-Id: Ouch... with ada.numerics.elementary_functions; use ada.numerics.elementary_functions; Highest_Bit_In_Octet:=natural(float'truncation(log(float(N),2.0))); I didn't check it for speed though. Pros that it doesn't depend on the size.