1 ------------------------------------------------------------------------------
3 -- GNAT RUNTIME COMPONENTS --
5 -- A D A . N U M E R I C S . A U X --
8 -- (C Library Version for x86) --
10 -- $Revision: 1.1.16.1 $
12 -- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
14 -- GNAT is free software; you can redistribute it and/or modify it under --
15 -- terms of the GNU General Public License as published by the Free Soft- --
16 -- ware Foundation; either version 2, or (at your option) any later ver- --
17 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
18 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
19 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
20 -- for more details. You should have received a copy of the GNU General --
21 -- Public License distributed with GNAT; see file COPYING. If not, write --
22 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
23 -- MA 02111-1307, USA. --
25 -- As a special exception, if other files instantiate generics from this --
26 -- unit, or you link this unit with other files to produce an executable, --
27 -- this unit does not by itself cause the resulting executable to be --
28 -- covered by the GNU General Public License. This exception does not --
29 -- however invalidate any other reasons why the executable file might be --
30 -- covered by the GNU Public License. --
32 -- GNAT was originally developed by the GNAT team at New York University. --
33 -- Extensive contributions were provided by Ada Core Technologies Inc. --
35 ------------------------------------------------------------------------------
37 -- This package provides the basic computational interface for the generic
38 -- elementary functions. The C library version interfaces with the routines
39 -- in the C mathematical library, and is thus quite portable, although it may
40 -- not necessarily meet the requirements for accuracy in the numerics annex.
41 -- One advantage of using this package is that it will interface directly to
42 -- hardware instructions, such as the those provided on the Intel x86.
44 -- Note: there are two versions of this package. One using the 80-bit x86
45 -- long double format (which is this version), and one using 64-bit IEEE
46 -- double (see file a-numaux.ads).
48 package Ada
.Numerics
.Aux
is
51 pragma Linker_Options
("-lm");
53 type Double
is digits 18;
55 function Sin
(X
: Double
) return Double
;
56 pragma Import
(C
, Sin
, "sinl");
58 function Cos
(X
: Double
) return Double
;
59 pragma Import
(C
, Cos
, "cosl");
61 function Tan
(X
: Double
) return Double
;
62 pragma Import
(C
, Tan
, "tanl");
64 function Exp
(X
: Double
) return Double
;
65 pragma Import
(C
, Exp
, "expl");
67 function Sqrt
(X
: Double
) return Double
;
68 pragma Import
(C
, Sqrt
, "sqrtl");
70 function Log
(X
: Double
) return Double
;
71 pragma Import
(C
, Log
, "logl");
73 function Acos
(X
: Double
) return Double
;
74 pragma Import
(C
, Acos
, "acosl");
76 function Asin
(X
: Double
) return Double
;
77 pragma Import
(C
, Asin
, "asinl");
79 function Atan
(X
: Double
) return Double
;
80 pragma Import
(C
, Atan
, "atanl");
82 function Sinh
(X
: Double
) return Double
;
83 pragma Import
(C
, Sinh
, "sinhl");
85 function Cosh
(X
: Double
) return Double
;
86 pragma Import
(C
, Cosh
, "coshl");
88 function Tanh
(X
: Double
) return Double
;
89 pragma Import
(C
, Tanh
, "tanhl");
91 function Pow
(X
, Y
: Double
) return Double
;
92 pragma Import
(C
, Pow
, "powl");