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=2.1 required=5.0 tests=BAYES_05,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!sunybcs!planck!corsair!westley From: westley@corsair.uucp (Terry J. Westley) Newsgroups: comp.lang.ada Subject: Re: language support for fixed-point arithmetic Keywords: fixed-point, arithmetic Message-ID: <1990Mar19.175559.17109@planck.uucp> Date: 19 Mar 90 17:55:59 GMT References: <787@eedsp.eedsp.gatech.edu> Sender: news@planck.uucp (Usenet News) Reply-To: westley%hercules@planck.UUCP (Terry J. Westley) Followup-To: comp.lang.ada Organization: Calspan Corporation ATC Buffalo, NY List-Id: In article <787@eedsp.eedsp.gatech.edu> baud@eedsp.eedsp.gatech.edu (Kurt Baudendistel) writes: > Ada supports an intrinsic fixed-point type that allows the user > to specify the range (maximum absolute value supported) and > scale (maximum required step-size). It is intended to be > implemented via an integer arithmetic unit to provide (1) fixed- > accuracy computations and (2) efficient execution in embedded > systems without floating-point hardware support. > >Please respond, and please respond by e-mail! If you are interested >in the results of my search, e-mail a result-request as well. > First, thanks to Mr. Baudendistel for posting technical questions and comments, not language war stuff. I find Watt, Wichmann, and Findlay's _ADA_Language_and_Methodology_ (Prentice-Hall) useful in teaching advanced Ada students about fixed point types. It includes a section on analyzing how the error bound grows when performing many fixed point type calculations. However, it is not a formal or exhaustive treatement of the subject. Please e-mail me or post the results. Fixed point types are potentially very useful, but I have run into a number of interesting educational challenges, all originating from users' expectations. (This is in a real-time system running on a distributed network of M68030 and Sun workstation environment.) 1. Designers and programmers understand why 'small must be a power of two, but they wish they could have it be any arbitrary size. In principle, this seems very possible, but I can see the performance problems that would crop up because people use a powerful feature without realizing what is really happening in the machine. 2. Users see the potential of fixed point types to give them the best of both worlds of real and integer types, and they want more of each. For example, they see a number as a real and expect to use the math co-processor. Naturally, converting back and forth to a floating point type destroys much the integer representation advantages. I am slowly beginning to get across the responsibility of the designer in choosing data types and the flexibility there is to add operations as needed. You give them an inch and they'll take a mile. Then, they complain that the compiler doesn't support the mile. Then, they realize they can bridge the mile themselves with not too much effort. Great stuff!! Terry J. Westley Arvin/Calspan Advanced Technology Center P.O. Box 400, Buffalo, NY 14225 acsu.buffalo.edu!planck!hercules!westley