2 |
7u83 |
1 |
/*
|
|
|
2 |
Crown Copyright (c) 1997
|
|
|
3 |
|
|
|
4 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
5 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
6 |
acting through the Defence Evaluation and Research Agency
|
|
|
7 |
(DERA). It is made available to Recipients with a
|
|
|
8 |
royalty-free licence for its use, reproduction, transfer
|
|
|
9 |
to other parties and amendment for any purpose not excluding
|
|
|
10 |
product development provided that any such use et cetera
|
|
|
11 |
shall be deemed to be acceptance of the following conditions:-
|
|
|
12 |
|
|
|
13 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
14 |
reproduced upon any copies or amended versions of it;
|
|
|
15 |
|
|
|
16 |
(2) Any amended version of it shall be clearly marked to
|
|
|
17 |
show both the nature of and the organisation responsible
|
|
|
18 |
for the relevant amendment or amendments;
|
|
|
19 |
|
|
|
20 |
(3) Its onward transfer from a recipient to another
|
|
|
21 |
party shall be deemed to be that party's acceptance of
|
|
|
22 |
these conditions;
|
|
|
23 |
|
|
|
24 |
(4) DERA gives no warranty or assurance as to its
|
|
|
25 |
quality or suitability for any purpose and DERA accepts
|
|
|
26 |
no liability whatsoever in relation to any use to which
|
|
|
27 |
it may be put.
|
|
|
28 |
*/
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
/*
|
|
|
32 |
STANDARD MATHS FUNCTION DEFINITIONS
|
|
|
33 |
|
|
|
34 |
These routines define the standard C maths functions which C++
|
|
|
35 |
overloads. Most are from cmath, although a couple are from cstdlib.
|
|
|
36 |
*/
|
|
|
37 |
|
|
|
38 |
#include <cstdlib>
|
|
|
39 |
#include <cmath>
|
|
|
40 |
using namespace std ;
|
|
|
41 |
|
|
|
42 |
long std::abs ( long a )
|
|
|
43 |
{
|
|
|
44 |
return ( labs ( a ) ) ;
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
ldiv_t std::div ( long a, long b )
|
|
|
48 |
{
|
|
|
49 |
return ( ldiv ( a, b ) ) ;
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
#if 0
|
|
|
53 |
float std::abs ( float ) ;
|
|
|
54 |
float std::acos ( float ) ;
|
|
|
55 |
float std::asin ( float ) ;
|
|
|
56 |
float std::atan ( float ) ;
|
|
|
57 |
float std::atan2 ( float, float ) ;
|
|
|
58 |
float std::ceil ( float ) ;
|
|
|
59 |
float std::cos ( float ) ;
|
|
|
60 |
float std::cosh ( float ) ;
|
|
|
61 |
float std::exp ( float ) ;
|
|
|
62 |
float std::fabs ( float ) ;
|
|
|
63 |
float std::floor ( float ) ;
|
|
|
64 |
float std::fmod ( float, float ) ;
|
|
|
65 |
float std::frexp ( float, int * ) ;
|
|
|
66 |
float std::modf ( float, float * ) ;
|
|
|
67 |
float std::ldexp ( float, int ) ;
|
|
|
68 |
float std::log ( float ) ;
|
|
|
69 |
float std::log10 ( float ) ;
|
|
|
70 |
float std::pow ( float, float ) ;
|
|
|
71 |
float std::pow ( float, int ) ;
|
|
|
72 |
float std::sin ( float ) ;
|
|
|
73 |
float std::sinh ( float ) ;
|
|
|
74 |
float std::sqrt ( float ) ;
|
|
|
75 |
float std::tan ( float ) ;
|
|
|
76 |
float std::tanh ( float ) ;
|
|
|
77 |
#endif
|
|
|
78 |
|
|
|
79 |
double std::abs ( double a )
|
|
|
80 |
{
|
|
|
81 |
return ( fabs ( a ) ) ;
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
#if 0
|
|
|
85 |
double std::pow ( double, int ) ;
|
|
|
86 |
#endif
|
|
|
87 |
|
|
|
88 |
#if 0
|
|
|
89 |
long double std::abs ( long double ) ;
|
|
|
90 |
long double std::acos ( long double ) ;
|
|
|
91 |
long double std::asin ( long double ) ;
|
|
|
92 |
long double std::atan ( long double ) ;
|
|
|
93 |
long double std::atan2 ( long double, long double ) ;
|
|
|
94 |
long double std::ceil ( long double ) ;
|
|
|
95 |
long double std::cos ( long double ) ;
|
|
|
96 |
long double std::cosh ( long double ) ;
|
|
|
97 |
long double std::exp ( long double ) ;
|
|
|
98 |
long double std::fabs ( long double ) ;
|
|
|
99 |
long double std::floor ( long double ) ;
|
|
|
100 |
long double std::fmod ( long double, long double ) ;
|
|
|
101 |
long double std::frexp ( long double, int * ) ;
|
|
|
102 |
long double std::modf ( long double, long double * ) ;
|
|
|
103 |
long double std::ldexp ( long double, int ) ;
|
|
|
104 |
long double std::log ( long double ) ;
|
|
|
105 |
long double std::log10 ( long double ) ;
|
|
|
106 |
long double std::pow ( long double, long double ) ;
|
|
|
107 |
long double std::pow ( long double, int ) ;
|
|
|
108 |
long double std::sin ( long double ) ;
|
|
|
109 |
long double std::sinh ( long double ) ;
|
|
|
110 |
long double std::sqrt ( long double ) ;
|
|
|
111 |
long double std::tan ( long double ) ;
|
|
|
112 |
long double std::tanh ( long double ) ;
|
|
|
113 |
#endif
|