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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,31d67020d4b04d5b X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Simple Real_Time.Time_Span question Date: 1998/10/14 Message-ID: #1/1 X-Deja-AN: 401021464 Sender: matt@mheaney.ni.net References: <6vvsgo$rvo$1@nnrp1.dejanews.com> <700usk$cht$1@nnrp1.dejanews.com> <702b25$30a$1@nnrp1.dejanews.com> NNTP-Posting-Date: Wed, 14 Oct 1998 09:05:45 PDT Newsgroups: comp.lang.ada Date: 1998-10-14T00:00:00+00:00 List-Id: dennison@telepath.com writes: > In article <700usk$cht$1@nnrp1.dejanews.com>, > dewar@gnat.com wrote: > > > It is odd for a compiler not to choose a sufficient precision for Duration > > to accurately represent a Time_Span value. Certainly in the case of GNAT, > > Duration is represented in nanoseconds, and you will not lose any precision > > following the conversion path you suggest. > > I hate to drag my own thread off topic, but how did you do that? According to > 9.6(27) Duration has to represent up to 86,400 seconds. For a "classical" > implementation of a fixed-point type that can represent both 86,400 and > 0.000_000_001, my poor calculations tell me you'd need at least 47 bits. On a > 32-bit processor that would be tricky. GNAT uses 64 bits to implement fixed point types. One of the reasons this is nice is that you can have an unsigned, 32 bit fixed point type.