@stdlib/math-base-special-acoshf
v0.1.1
Published
Compute the hyperbolic arccosine of a single-precision floating-point number.
Readme
acoshf
Compute the hyperbolic arccosine of a single-precision floating-point number.
Installation
npm install @stdlib/math-base-special-acoshfUsage
var acoshf = require( '@stdlib/math-base-special-acoshf' );acoshf( x )
Computes the hyperbolic arccosine of a single-precision floating-point number.
var v = acoshf( 1.0 );
// returns 0.0
v = acoshf( 2.0 );
// returns ~1.317
v = acoshf( 0.5 );
// returns NaNThe domain of x is restricted to [1,+infinity). If x < 1, the function will return NaN.
var v = acoshf( 0.0 );
// returns NaNExamples
var uniform = require( '@stdlib/random-array-uniform' );
var logEachMap = require( '@stdlib/console-log-each-map' );
var acoshf = require( '@stdlib/math-base-special-acoshf' );
var opts = {
'dtype': 'float32'
};
var x = uniform( 100, 1.0, 100.0, opts );
logEachMap( 'acoshf(%0.4f) = %0.4f', x, acoshf );C APIs
Usage
#include "stdlib/math/base/special/acoshf.h"stdlib_base_acoshf( x )
Computes the hyperbolic arccosine of a single-precision floating-point number.
float out = stdlib_base_acoshf( 1.0f );
// returns 0.0f
out = stdlib_base_acoshf( 2.0f );
// returns ~1.317fThe function accepts the following arguments:
- x:
[in] floatinput value.
float stdlib_base_acoshf( const float x );Examples
#include "stdlib/math/base/special/acoshf.h"
#include <stdlib.h>
#include <stdio.h>
int main( void ) {
float x;
float v;
int i;
for ( i = 0; i < 100; i++ ) {
x = ( (float)rand() / (float)RAND_MAX ) * 100.0f;
v = stdlib_base_acoshf( x );
printf( "acoshf(%f) = %f\n", x, v );
}
}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
Copyright
Copyright © 2016-2026. The Stdlib Authors.
