@stdlib/math-base-special-csch
v0.3.0
Published
Compute the hyperbolic cosecant of a number.
Downloads
35
Readme
csch
Compute the hyperbolic cosecant of a number.
Installation
npm install @stdlib/math-base-special-csch
Usage
var csch = require( '@stdlib/math-base-special-csch' );
csch( x )
Computes the hyperbolic cosecant of x
.
var v = csch( 0.0 );
// returns Infinity
v = csch( 2.0 );
// returns ~0.2757
v = csch( -2.0 );
// returns ~-0.2757
v = csch( NaN );
// returns NaN
Examples
var linspace = require( '@stdlib/array-base-linspace' );
var csch = require( '@stdlib/math-base-special-csch' );
var x = linspace( -5.0, 5.0, 100 );
var i;
for ( i = 0; i < x.length; i++ ) {
console.log( csch( x[ i ] ) );
}
C APIs
Usage
#include "stdlib/math/base/special/csch.h"
stdlib_base_csch( x )
Computes the hyperbolic cosecant of double-precision floating-point number x
.
double out = stdlib_base_csch( 2.0 );
// returns ~0.2757
out = stdlib_base_csch( -2.0 );
// returns ~-0.2757
The function accepts the following arguments:
- x:
[in] double
input value.
double stdlib_base_csch( const double x );
Examples
#include "stdlib/math/base/special/csch.h"
#include <stdio.h>
int main( void ) {
const double x[] = { -4.0, -3.11, -2.22, -1.33, -0.44, 0.44, 1.33, 2.22, 3.11, 4.0 };
double v;
int i;
for ( i = 0; i < 10; i++ ) {
v = stdlib_base_csch( x[ i ] );
printf( "csch(%lf) = %lf\n", x[ i ], v );
}
}
See Also
@stdlib/math-base/special/acsch
: compute the hyperbolic arccosecant of a number.@stdlib/math-base/special/coth
: compute the hyperbolic cotangent of a number.@stdlib/math-base/special/sinh
: compute the hyperbolic sine of a double-precision floating-point number.
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.