comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pogner.demon.co.uk>
Subject: Re: Maths LIb
Date: 1997/10/18
Date: 1997-10-18T00:00:00+00:00	[thread overview]
Message-ID: <x7vlnzrdr7i.fsf@pogner.demon.co.uk> (raw)
In-Reply-To: 877175772.10098.0.nnrp-08.9e988f8e@news.demon.co.uk

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]


"DRD Woodward" <doig@mwangi.demon.co.uk> writes:

> I'm using !!@*&^ AvtivAda ^^&%�!!? and having severe problems.

I use GNAT.

> It tells me that the package I require, (GENERIC_ELEMENTARY_FUNCTIONS),
>  is already compiled,and all I need do is use the a global  'With' clause,
> then Instantiate it.( $%�&)

This sounds (pardon me if I'm wrong) as though you aren't very familiar
with Ada?

> It compiles ok. but 'bind' says package (GENERIC_ELEMENTARY_FUNCTIONS)
> not compiled.

Perhaps if you gave us a source example we would be better able to help.

> Any way as I,m tied into using Ada and for now this heap of Binary Dross
> (deadline in eight days.... and counting....) I wonder if one of you kind
> people out there might have an appropriate maths package (Spec+Body) that
> contains at least the Tanh function and are happy to wing it down the wires
> to me as soon as possible.

It's called Ada.Numerics.Generic_Elementary_Functions -- see example:

with Ada.Text_Io;
with Ada.Float_Text_Io;
with Ada.Numerics.Generic_Elementary_Functions;
procedure Math is
  package Funcs is new Ada.Numerics.Generic_Elementary_Functions (Float);
  X : Float := 0.5;
  Y : Float;
begin
  Y := Funcs.Tanh (X);
  Ada.Text_Io.Put ("tanh(0.5) is");
  Ada.Float_Text_Io.Put (Y);
  Ada.Text_Io.New_Line;
end Math;

Output is "tanh(0.5) is 4.62117E-01", is that OK?

> ANSI/MIL-STD-1815A-1983

Of course, if you're using Ada83 this particular solution won't help
you -- but then, you said you're using ActiveAda --

-- 
Simon Wright                        Work Email: simon.j.wright@gecm.com
GEC-Marconi Radar & Defence Systems            Voice: +44(0)1705-701778
Command & Information Systems Divsion            FAX: +44(0)1705-701800




  reply	other threads:[~1997-10-18  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-18  0:00 Maths LIb DRD Woodward
1997-10-18  0:00 ` Simon Wright [this message]
1997-10-18  0:00   ` Keith Thompson
1997-10-19  0:00 ` Tom Moran
1997-10-23  0:00 ` Marc Bejerano
replies disabled

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