comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob.S.Rosenberg.1@gsfc.nasa.gov (Jacob S. Rosenberg.)
Subject: Re: Math functions in Ada
Date: 1997/05/16
Date: 1997-05-16T00:00:00+00:00	[thread overview]
Message-ID: <5lhvrk$cqj@mtinsc05.worldnet.att.net> (raw)
In-Reply-To: 5ka4nc$man@news1.mnsinc.com


wfrye@mnsinc.com (William Frye) wrote:


>Is a there a source of freeware Ada routines for simple math functions?
>I am particularly interested in a routine  to calculate x**y where x and y
>are floating point numbers.  I am working with gnat on a Win95 platform.

Hi William,

First of all, x**y equals exp(y * log(x)).  So, all you need are the
log (logarithm) and exp (exponential) functions.  It should be failrly
easy to write such a function as log and exp are generally provided.
Indeed, the whole thing would be:

return exp(y * log(x));

I strongly recommend that the input values and the functions used are
of type long_float and not float in order to provide greater range and
accuracy.  The function itself could return a float.  In that case,
you can do a conversion to float before the return statement.

Regards,

Jacob Rosenberg

To find out about more job openings, please visit my website at
http://www.jobspot.com.  There are many more job listings in a
variety of industries and in many technical specialties.
 
All agency fees are paid by the companies.  Interview and  
relocation costs are usually reimbursed by the companies.  
Please send your resume by mail, fax, or e-mail. For best
quality, you are welcom to email your resume as an attached
file. 
Thanks and lots of luck!


Pearl Martin
Image Associates Inc.
5254 Merrick Road
Massapequa, NY  11758
Phone:  (516)798-3993
Fax:  (516)797-8703
E-Mail:  image@worldnet.att.net or headhunter@jobspot.com
--






  parent reply	other threads:[~1997-05-16  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-01  0:00 Math functions in Ada William Frye
1997-05-01  0:00 ` David C. Hoos, Sr.
1997-05-05  0:00   ` Doug Smith
1997-05-06  0:00   ` Keith Thompson
1997-05-16  0:00 ` Jacob S. Rosenberg. [this message]
1997-05-16  0:00   ` Robert Dewar
1997-05-17  0:00   ` John G. Volan
replies disabled

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