1 ------------------------------------------------------------------------------
3 -- GNAT RUNTIME COMPONENTS --
5 -- A D A . N U M E R I C S . A U X --
8 -- (C Library Version, VxWorks) --
11 -- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
24 -- As a special exception, if other files instantiate generics from this --
25 -- unit, or you link this unit with other files to produce an executable, --
26 -- this unit does not by itself cause the resulting executable to be --
27 -- covered by the GNU General Public License. This exception does not --
28 -- however invalidate any other reasons why the executable file might be --
29 -- covered by the GNU Public License. --
31 -- GNAT was originally developed by the GNAT team at New York University. --
32 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
34 ------------------------------------------------------------------------------
36 -- This package provides the basic computational interface for the generic
37 -- elementary functions. The C library version interfaces with the routines
38 -- in the C mathematical library, and is thus quite portable, although it may
39 -- not necessarily meet the requirements for accuracy in the numerics annex.
40 -- One advantage of using this package is that it will interface directly to
41 -- hardware instructions, such as the those provided on the Intel x86.
43 -- Note: there are two versions of this package. One using the normal IEEE
44 -- 64-bit double format (which is this version), and one using 80-bit x86
45 -- long double (see file 4onumaux.ads).
47 package Ada
.Numerics
.Aux
is
50 -- This version omits the pragma linker_options ("-lm") since there is
51 -- no libm.a library for VxWorks.
53 type Double
is digits 15;
54 pragma Float_Representation
(IEEE_Float
, Double
);
55 -- Type Double is the type used to call the C routines. Note that this
56 -- is IEEE format even when running on VMS with Vax_Float representation
57 -- since we use the IEEE version of the C library with VMS.
59 function Sin
(X
: Double
) return Double
;
60 pragma Import
(C
, Sin
, "sin");
62 function Cos
(X
: Double
) return Double
;
63 pragma Import
(C
, Cos
, "cos");
65 function Tan
(X
: Double
) return Double
;
66 pragma Import
(C
, Tan
, "tan");
68 function Exp
(X
: Double
) return Double
;
69 pragma Import
(C
, Exp
, "exp");
71 function Sqrt
(X
: Double
) return Double
;
72 pragma Import
(C
, Sqrt
, "sqrt");
74 function Log
(X
: Double
) return Double
;
75 pragma Import
(C
, Log
, "log");
77 function Acos
(X
: Double
) return Double
;
78 pragma Import
(C
, Acos
, "acos");
80 function Asin
(X
: Double
) return Double
;
81 pragma Import
(C
, Asin
, "asin");
83 function Atan
(X
: Double
) return Double
;
84 pragma Import
(C
, Atan
, "atan");
86 function Sinh
(X
: Double
) return Double
;
87 pragma Import
(C
, Sinh
, "sinh");
89 function Cosh
(X
: Double
) return Double
;
90 pragma Import
(C
, Cosh
, "cosh");
92 function Tanh
(X
: Double
) return Double
;
93 pragma Import
(C
, Tanh
, "tanh");
95 function Pow
(X
, Y
: Double
) return Double
;
96 pragma Import
(C
, Pow
, "pow");