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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6a77269912f77a70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-23 15:06:29 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.mathworks.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!attbi_s51.POSTED!not-for-mail Message-ID: <3F98508F.2030300@comcast.net> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Why no 'Floor for fixed point types References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.34.139.183 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s51 1066946788 24.34.139.183 (Thu, 23 Oct 2003 22:06:28 GMT) NNTP-Posting-Date: Thu, 23 Oct 2003 22:06:28 GMT Organization: Comcast Online Date: Thu, 23 Oct 2003 22:06:28 GMT Xref: archiver1.google.com comp.lang.ada:1552 Date: 2003-10-23T22:06:28+00:00 List-Id: Duncan Sands wrote: > I think the subject says it all. Just curious. For floating-point types, integer values are either model numbers or in a range limited by two integer model numbers. (Or are IEEE infinities or NANs.) But for fixed-point types, there may be few integer values that can be represented. A typical example might be: type Radians is delta Pi/1000 range -Pi..Pi; for Radians'small use Pi/1000; where the only integer value of the type is zero. For type Radians what should Radians'Floor return? It doesn't make much sense for it to return a value that is approximately an integer, especially since Radians'Floor(Radians'Floor(X)) = Randians'Floor(X) could return false. It might be nice to have a type conversion to Integer that truncated instead of rounding, but that is a different question. -- Robert I. Eachus "Quality is the Buddha. Quality is scientific reality. Quality is the goal of Art. It remains to work these concepts into a practical, down-to-earth context, and for this there is nothing more practical or down-to-earth than what I have been talking about all along...the repair of an old motorcycle." -- from Zen and the Art of Motorcycle Maintenance by Robert Pirsig