OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_BASE_IEEE754_H_ | 5 #ifndef V8_BASE_IEEE754_H_ |
6 #define V8_BASE_IEEE754_H_ | 6 #define V8_BASE_IEEE754_H_ |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace base { | 9 namespace base { |
10 namespace ieee754 { | 10 namespace ieee754 { |
11 | 11 |
12 // Returns the principal value of the arc tangent of |x|; that is the value | 12 // Returns the principal value of the arc tangent of |x|; that is the value |
13 // whose tangent is |x|. | 13 // whose tangent is |x|. |
14 double atan(double x); | 14 double atan(double x); |
15 | 15 |
16 // Returns the principal value of the arc tangent of |y/x|, using the signs of | 16 // Returns the principal value of the arc tangent of |y/x|, using the signs of |
17 // the two arguments to determine the quadrant of the result. | 17 // the two arguments to determine the quadrant of the result. |
18 double atan2(double y, double x); | 18 double atan2(double y, double x); |
19 | 19 |
| 20 // Returns the cosine of |x|, where |x| is given in radians. |
| 21 double cos(double x); |
| 22 |
20 // Returns the base-e exponential of |x|. | 23 // Returns the base-e exponential of |x|. |
21 double exp(double x); | 24 double exp(double x); |
22 | 25 |
23 double atanh(double x); | 26 double atanh(double x); |
24 | 27 |
25 // Returns the natural logarithm of |x|. | 28 // Returns the natural logarithm of |x|. |
26 double log(double x); | 29 double log(double x); |
27 | 30 |
28 // Returns a value equivalent to |log(1+x)|, but computed in a way that is | 31 // Returns a value equivalent to |log(1+x)|, but computed in a way that is |
29 // accurate even if the value of |x| is near zero. | 32 // accurate even if the value of |x| is near zero. |
30 double log1p(double x); | 33 double log1p(double x); |
31 | 34 |
32 // Return the base 2 logarithm of |x|. | 35 // Returns the base 2 logarithm of |x|. |
33 double log2(double x); | 36 double log2(double x); |
34 | 37 |
35 // Return the base 10 logarithm of |x|. | 38 // Returns the base 10 logarithm of |x|. |
36 double log10(double x); | 39 double log10(double x); |
37 | 40 |
38 // Return cube root of |x|. | 41 // Returns the cube root of |x|. |
39 double cbrt(double x); | 42 double cbrt(double x); |
40 | 43 |
41 // Returns exp(x)-1, the exponential of |x| minus 1. | 44 // Returns exp(x)-1, the exponential of |x| minus 1. |
42 double expm1(double x); | 45 double expm1(double x); |
43 | 46 |
| 47 // Returns the sine of |x|, where |x| is given in radians. |
| 48 double sin(double x); |
| 49 |
44 } // namespace ieee754 | 50 } // namespace ieee754 |
45 } // namespace base | 51 } // namespace base |
46 } // namespace v8 | 52 } // namespace v8 |
47 | 53 |
48 #endif // V8_BASE_IEEE754_H_ | 54 #endif // V8_BASE_IEEE754_H_ |
OLD | NEW |