Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!uflorida!mlb.semi.harris.com!trantor.harris-atd.com!x102c.ess.harris.com!gbastin From: gbastin@x102c.ess.harris.com (Gary Bastin 60293) Newsgroups: comp.lang.fortran Subject: Arbitrary Digit Arithmetic Message-ID: <6005@trantor.harris-atd.com> Date: 5 Apr 91 15:29:50 GMT Sender: news@trantor.harris-atd.com Reply-To: gbastin@x102c.ess.harris.com (Gary Bastin 60293) Organization: Harris Corporation GSS, Melbourne, Florida Lines: 21 I am looking for a way to perform arbitrary number rounding, up to the maximum possible for the data type, for arithmetical operations. For example, assume that 4 digit accuracy is desired and REAL types are used, giving approximately 6 or 7 digits of accuracy, depending upon the platform. Then, the problem is to perform the arithmetic operation, and round the result to 4 digits. A function ROUND(x,n) could be written for a specific platform, taking advantage of the internal storage technique used by a particular compiler, and which would basicly round the mantissa to n-digits, leaving the exponent unaffected (for n <= the maximum number of digits possible for the data type). But, has anyone got any F77 source code for such a function that would be portable between platforms? Thanks in advance! Gary Bastin, WB4YAF /-/-/ Internet: gbastin@x102c.ess.harris.com Mail Stop 102-4826 | phone: (407) 729-3045 Harris Corporation GASD | P.O.B. 94000, Melbourne FL 32902 Speaking from, but not for, Harris!