You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/math/base/special/cosm1f/README.md
+18-24Lines changed: 18 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,10 +32,10 @@ var cosm1f = require( '@stdlib/math/base/special/cosm1f' );
32
32
33
33
#### cosm1f( x )
34
34
35
-
Computes `cos(x) - 1`, where `cos` is the [cosine][@stdlib/math/base/special/cos] of a `number` (in radians). This function should be used instead of manually calculating `cos(x) - 1` when the argument is near unity.
35
+
Computes `cos(x) - 1`, where `cos` is the [cosine][cosine] of a single-precision floating-point number (in radians). This function should be used instead of manually calculating `cos(x) - 1` when the argument is near unity.
36
36
37
37
```javascript
38
-
varPI=require( '@stdlib/constants/float64/pi' );
38
+
varPI=require( '@stdlib/constants/float32/pi' );
39
39
40
40
var v =cosm1f( 0.0 );
41
41
// returns 0.0
@@ -63,11 +63,11 @@ v = cosm1f( NaN );
63
63
```javascript
64
64
var uniform =require( '@stdlib/random/array/uniform' );
65
65
var logEachMap =require( '@stdlib/console/log-each-map' );
66
-
varPI=require( '@stdlib/constants/float64/pi' );
66
+
varPI=require( '@stdlib/constants/float32/pi' );
67
67
var cosm1f =require( '@stdlib/math/base/special/cosm1f' );
Computes `cos(x) - 1`, where `cos` is the [cosine][@stdlib/math/base/special/cos] of a `number` (in radians). This function should be used instead of manually calculating `cos(x) - 1` when the argument is near unity.
109
+
Computes `cos(x) - 1`, where `cos` is the [cosine][cosine] of a single-precision floating-point number (in radians). This function should be used instead of manually calculating `cos(x) - 1` when the argument is near unity.
110
110
111
111
```c
112
-
double out = stdlib_base_cosm1( 0.0 );
113
-
// returns 0.0
112
+
float out = stdlib_base_cosm1f( 0.0f );
113
+
// returns 0.0f
114
114
115
-
out = stdlib_base_cosm1( 3.141592653589793238 / 4.0 );
116
-
// returns ~-0.293
115
+
out = stdlib_base_cosm1f( 3.141592653589793238f / 4.0f );
116
+
// returns ~-0.293f
117
117
```
118
118
119
119
The function accepts the following arguments:
120
120
121
-
-**x**: `[in] double` input value.
121
+
-**x**: `[in] float` input value.
122
122
123
123
```c
124
-
doublestdlib_base_cosm1( const double x );
124
+
floatstdlib_base_cosm1f( const float x );
125
125
```
126
126
127
127
</section>
@@ -147,13 +147,13 @@ double stdlib_base_cosm1( const double x );
- <spanclass="package-name">[`@stdlib/math/base/special/cos`][@stdlib/math/base/special/cos]</span><spanclass="delimiter">: </span><spanclass="description">compute the cosine of a number.</span>
0 commit comments