From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=BAYES_20,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a05:6214:1227:: with SMTP id p7mr76022448qvv.31.1609759738859; Mon, 04 Jan 2021 03:28:58 -0800 (PST) X-Received: by 2002:a25:6ec3:: with SMTP id j186mr107187848ybc.165.1609759738644; Mon, 04 Jan 2021 03:28:58 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 4 Jan 2021 03:28:58 -0800 (PST) In-Reply-To: <283abde6-81b9-4194-b695-1b4686634d97n@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.133; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 94.31.101.133 References: <7fe2291a-bc12-4708-85aa-0ffbdc25b2bfn@googlegroups.com> <283abde6-81b9-4194-b695-1b4686634d97n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Quick inverse square root From: AdaMagica Injection-Date: Mon, 04 Jan 2021 11:28:58 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:61026 List-Id: AdaMagica schrieb am Montag, 4. Januar 2021 um 12:13:53 UTC+1: > > with INTERFACES; use INTERFACES; > > generic > > type F is digits <>; > > type U is mod <>; > > with function SHIFT_RIGHT( n : U; amount : NATURAL ) return U; > > function G_QUICK_INVERSE_SQRT( a : F ) return F; I haven't got the slightest idea for which range this function should be applied, but for sure not for the complete Float range. Thus there should be an assertion about the range of the parameter a in the body. Or even better a precondition in the spec.