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,f8311a3a7edd715 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-17 22:25:52 PST Path: supernews.google.com!sn-xit-02!supernews.com!router1.news.adelphia.net!cyclone.news.idirect.com.MISMATCH!newsfeed.direct.ca!look.ca!newsfeed.bc.tac.net!news.bc.tac.net!not-for-mail Sender: blaak@TORUS Newsgroups: comp.lang.ada Subject: Re: Using "delay until" in real-time References: <915jl7$jt5$1@nnrp1.deja.com> <915p5n$p2j$1@nnrp1.deja.com> <915vv7$vfo$1@nnrp1.deja.com> From: Ray Blaak Message-ID: Organization: The Transcend X-Newsreader: Gnus v5.6.42/Emacs 19.34 Date: 17 Dec 2000 22:26:09 -0800 NNTP-Posting-Host: 209.53.149.68 X-Complaints-To: news@bctel.net X-Trace: news.bc.tac.net 977120734 209.53.149.68 (Sun, 17 Dec 2000 22:25:34 PST) NNTP-Posting-Date: Sun, 17 Dec 2000 22:25:34 PST Xref: supernews.google.com comp.lang.ada:3222 Date: 2000-12-17T22:26:09-08:00 List-Id: Ted Dennison writes: > I see a couple of problems with this. [...] > o Iteration_Count * Iteration_Hz is no different mathematicly from > adding Iteration_Hz to Start_Time Iteration_Count times, which is what I > was doing. You'd still get the same compounding round-off error. Would it? It might be the same mathematically, but computers don't do Real arithmetic mathematically, only approximately. Consider floating arithmetic accurate to 2 decimal places: Hz = 60, Inc = 1/Hz = 1.67 Adding incrementally twice: Inc + Inc = 3.34 Multiplying 2 iterations from a start time of zero: (1 + 1) / 60 = 3.33 The trick is to divide the total count so far by your Hz, not multiply by a precomputed 1/Hz. -- Cheers, The Rhythm is around me, The Rhythm has control. Ray Blaak The Rhythm is inside me, blaak@infomatch.com The Rhythm has my soul.