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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site harvard.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!harvard!macrakis From: macrakis@harvard.ARPA (Stavros Macrakis) Newsgroups: net.lang,net.lang.ada Subject: Re: What language do you use for scientific programming? Message-ID: <324@harvard.ARPA> Date: Tue, 27-Aug-85 13:11:24 EDT Article-I.D.: harvard.324 Posted: Tue Aug 27 13:11:24 1985 Date-Received: Thu, 29-Aug-85 21:49:46 EDT References: <909@oddjob.UUCP> <64500002@hpislb.UUCP> <627@petsd.UUCP> Organization: Aiken Comp. Lab., Harvard Xref: linus net.lang:1535 net.lang.ada:306 List-Id: > >[Ada] does have double-precision real.... you can ... specify > >arbitrary precision, [but if there's no appropriate] hardware data > >type,... you could be executing... simulation code). > > No simulation code is ever required. Ada allows operations to be > performed with more precision than the user requested. Therefore, > all operations are done with the next better floating point type in > the machine. The "predefined types" of the implementation should > correspond with supported types on the machine. These two notes appear to be talking to to different issues: run-time calculations in floating types, and calculation of `universal numbers' at compile time. Ada allows of the precision of floating types. An implementation chooses which precisions it supports, and must give an error if a program specifies a precision it does not support. Implementations are required to support at least one floating precision. Precisions are specifed by number of digits rather than as `single' or `double' precision, increasing portability. As for compile-time constants (`universal numbers'): "The accuracy of the evaluation of [such numbers] is at least as good as that of the most accurate predefined floating point type...." [Ada RM 4.10/4] Earlier versions of Ada did apparently require arbitrary-precision arithmetic at compile time (but never at run time). Of course, if you want run-time multiple precision, you are free to implement it in a package and use overloading to call its operations `+', `*', etc. This holds true for vector-matrix, complex, and other types as well. > All in all, I agree with you in selecting Ada as your language of > choice. Unlike C, however, an efficient Ada program requires a > damn-good optimizing compiler. -- Joe Orost I also agree. Choose Ada for numeric calculations. This year's crop of compilers finally seems to be fulfilling Ada's promise. -s