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,16dbd7ecc6a3d50c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Fri, 05 May 2006 15:31:43 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1146756192.545514.109110@i39g2000cwa.googlegroups.com> Subject: Re: Ada decimal types Date: Fri, 5 May 2006 15:32:07 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-eqxgoyWzI/K5VXOC9LxcV/pOEb9+uva0kJWGDkbdTvnSB3eFA6bxudmgMadQVsm+g56N2JdiUZnQHdb!gmo6MbrOowXZCVP+3/NcaNf/pfXQMFOU4BzP1LpQNIy9W3ldLmSkiXHKg4+BKz+yN56fZbOnKHf8 X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:4103 Date: 2006-05-05T15:32:07-05:00 List-Id: "REH" wrote in message news:sKG6g.6427$TT.4592@twister.nyroc.rr.com... > > I would use a fixed point type, not a decimal type. > A decimal type is a fixed pointed type. I don't want to use a binary fixed > point because it would change the precision. Currently any value of > microsecond granularity can be represented. If I use a binary fixed point, > that would change. Decimal fixed point types have different rules for rounding in operations like "*" and "/" than regular ("ordinary") fixed point does. Be sure that that behavior doesn't matter to your application. Otherwise, there is no difference between a decimal fixed point and an ordinary fixed point with an appropriate small clause: type Mission_Time_Type is delta 1.0e-6 range 0.0 .. (2.0**32) - 1.0; for Mission_Time_Type'Small use 1.0e-6; Ada 95 compilers *could* reject the above, but since they have to implement it anyway to support decimal types, there is no good reason to do so. Randy.