diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b964df47..dbd828bfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2263,6 +2263,7 @@ This release closes the following issue: ##### Features +- [`fdba877`](https://github.com/stdlib-js/stdlib/commit/fdba877adb81859aa87b72685f19a8921d4dd8db) - add C implementation for `math/base/special/csc` [(##2367)](#2367 ) - [`b60ef62`](https://github.com/stdlib-js/stdlib/commit/b60ef6245ac44dbef3076f1122e91f4aa8406e6c) - add `math/base/special/csc` @@ -4528,6 +4529,7 @@ A total of 26 people contributed to this release. Thank you to the following con
+- [`fdba877`](https://github.com/stdlib-js/stdlib/commit/fdba877adb81859aa87b72685f19a8921d4dd8db) - **feat:** add C implementation for `math/base/special/csc` [(##2367)](#2367 ) _(by Gunj Joshi)_ - [`ae92cf0`](https://github.com/stdlib-js/stdlib/commit/ae92cf0e2ff55d9e0d490ece6bd32eb8da0506a9) - **fix:** use significand mask in `math/base/special/rempio2` [(##2366)](#2366) _(by Gunj Joshi)_ - [`9df1610`](https://github.com/stdlib-js/stdlib/commit/9df16105aa2d89808d3395c610334ca9cce35b3c) - **docs:** remove long comment [(##2634)](#2634) _(by Gunj Joshi)_ - [`3cf2e89`](https://github.com/stdlib-js/stdlib/commit/3cf2e897adf5128f94bd7279e88ca9d42dfe7caa) - **feat:** add C implementation for `math/base/special/coversin` [(##2361)](#2361) _(by Gunj Joshi)_ diff --git a/base/special/csc/README.md b/base/special/csc/README.md index c9cc0a3b5..8949f4ab5 100644 --- a/base/special/csc/README.md +++ b/base/special/csc/README.md @@ -43,7 +43,7 @@ var v = csc( 0.0 ); // returns Infinity v = csc( 3.141592653589793/2.0 ); -// returns ~1.0 +// returns 1.0 v = csc( -3.141592653589793/6.0 ); // returns ~-2.0 @@ -82,6 +82,94 @@ for ( i = 0; i < x.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/csc.h" +``` + +#### stdlib_base_csc( x ) + +Evaluates the [cosecant][trigonometric-functions] of `x` (in radians). + +```c +double out = stdlib_base_csc( 0.0 ); +// returns Infinity + +out = stdlib_base_cos( 3.141592653589793 / 2.0 ); +// returns 1.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_csc( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/csc.h" +#include + +int main( void ) { + const double x[] = { 0.523, 0.785, 1.047, 3.14 }; + + double y; + int i; + for ( i = 0; i < 4; i++ ) { + y = stdlib_base_csc( x[ i ] ); + printf( "csc(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +