comp.lang.ada
 help / color / mirror / Atom feed
From: macrakis@harvard.ARPA (Stavros Macrakis)
Subject: Re: What language do you use for scientific programming?
Date: Tue, 27-Aug-85 13:11:24 EDT	[thread overview]
Date: Tue Aug 27 13:11:24 1985
Message-ID: <324@harvard.ARPA> (raw)
In-Reply-To: 627@petsd.UUCP

> >[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 <specification> 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

      reply	other threads:[~1985-08-27 17:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <909@oddjob.UUCP>
     [not found] ` <64500002@hpislb.UUCP>
1985-08-26 16:04   ` What language do you use for scientific programming? Joe Orost
1985-08-27 17:11     ` Stavros Macrakis [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox