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-Thread: 103376,b2923d60cb81694b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!n33g2000cwc.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: Unsigned Integer Restraint Errors Date: 13 Mar 2007 09:42:57 -0700 Organization: http://groups.google.com Message-ID: <1173804176.860500.227030@n33g2000cwc.googlegroups.com> References: <1173712032.183064.264340@8g2000cwh.googlegroups.com> <1173726806.656979.305660@8g2000cwh.googlegroups.com> <1173787790.826099.287610@s48g2000cws.googlegroups.com> <1173797935.875023.7590@p10g2000cwp.googlegroups.com> <1173801854.505211.245650@64g2000cwx.googlegroups.com> <1173804099.317171.256990@p10g2000cwp.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1173804181 5025 127.0.0.1 (13 Mar 2007 16:43:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 13 Mar 2007 16:43:01 +0000 (UTC) In-Reply-To: <1173804099.317171.256990@p10g2000cwp.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: n33g2000cwc.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news1.google.com comp.lang.ada:14519 Date: 2007-03-13T09:42:57-07:00 List-Id: On Mar 13, 9:41 am, "Adam Beneschan" wrote: > On Mar 13, 9:04 am, "Adam Beneschan" wrote: > > > By the way, if I were going to write a loop that goes from 2 to > > sqrt(n)/2 + 1, I wouldn't use Sqrt like this: > > > for I in 2 .. Integer(Float'Floor(Sqrt(Float(N))/2.0)) + 1 loop... > > > but rather, I'd just write it something like this: > > > I := 2; > > while (2 * I - 1) * (2 * I - 1) <= N loop -- I think I got this > > right > > No, I didn't. Jeff did. I must have read (sqrt(n)+1)/2 or > something. Oops. Ooops again---I meant Dmitry, not Jeff. Wow, I'm off to a really good start today. -- Adam