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: dennison@telepath.com Subject: Re: Simple Real_Time.Time_Span question Date: 1998/10/13 Message-ID: <700ic6$q1p$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 400727612 References: <6vvsgo$rvo$1@nnrp1.dejanews.com> <7003e4$534@hacgate2.hac.com> X-Http-Proxy: 1.0 x5.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Tue Oct 13 21:57:26 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.05 [en] (WinNT; I) Date: 1998-10-13T00:00:00+00:00 List-Id: In article <7003e4$534@hacgate2.hac.com>, "David C. Hoos, Sr." wrote: > > dennison@telepath.com wrote in message <6vvsgo$rvo$1@nnrp1.dejanews.com>... > >I need to convert values of Ada.Real_Time.Time_Span into floating point > >values for use in time-based simulation calculations. I'd think there *has* > >to be a way to do this, but I don't see one. All I see is the ability to do > >it indirectly via a conversion to Duration. But that looses the extra > >accuracy of Time_Span, which was the whole point of using it in the first > >place. > > > >Am I missing something? > > Yes, a couple of things, anyway, viz.: > > 1. I think you're talking about precision and not accuracy. Ok. Fine. "precision". > 2. Since the types involved are defined in the RM as > implementation-dependent, it is implementation-dependent whether there is > any loss of precision going from Ada.Real_Time.Time_Span to Duration. In I didn't miss that at all. That *was my point*. Consider the following: o My vendor didn't bother to document the definition of Duration. o This code is very likely to be ported to other RTOS/Compiler combinations. o A typical real time simulation needs to perform floating-point caculations based on the elapsed time since the last calculation. I know telemetry applications also need this. Probably many (most?) other real-time application domains need this as well. Thus a package billed as "Real_Time" ought to provide a portable way to get a floating point value of a delta time (time_span). Where is it? -- T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own