@stdlib/math-base-special-asinf
v0.1.1
Published
Compute the arcsine of a single-precision floating-point number.
Downloads
76
Readme
asinf
Compute the arcsine of a single-precision floating-point number.
Installation
npm install @stdlib/math-base-special-asinf
Usage
var asinf = require( '@stdlib/math-base-special-asinf' );
asinf( x )
Computes the arcsine of a single-precision floating-point number (in radians).
var v = asinf( 0.0 );
// returns 0.0
v = asinf( -3.14/6.0 );
// returns ~-0.551
Examples
var linspace = require( '@stdlib/array-base-linspace' );
var asinf = require( '@stdlib/math-base-special-asinf' );
var x = linspace( -1.0, 1.0, 100 );
var i;
for ( i = 0; i < x.length; i++ ) {
console.log( asinf( x[ i ] ) );
}
C APIs
Usage
#include "stdlib/math/base/special/asinf.h"
stdlib_base_asinf( x )
Computes the arcsine of a single-precision floating-point number (in radians).
float out = stdlib_base_asinf( 0.0f );
// returns 0.0f
out = stdlib_base_asinf( -3.14f/6.0f );
// returns ~-0.551f
The function accepts the following arguments:
- x:
[in] float
input value (in radians).
float stdlib_base_asinf( const float x );
Examples
#include "stdlib/math/base/special/asinf.h"
#include <stdio.h>
int main( void ) {
const float x[] = { -1.0f, -0.78f, -0.56f, -0.33f, -0.11f, 0.11f, 0.33f, 0.56f, 0.78f, 1.0f };
float v;
int i;
for ( i = 0; i < 10; i++ ) {
v = stdlib_base_asinf( x[ i ] );
printf( "asin(%f) = %f\n", x[ i ], v );
}
}
See Also
@stdlib/math-base/special/asin
: compute the arcsine of a double-precision floating-point number.@stdlib/math-base/special/asindf
: compute the arcsine (in degrees) of a single-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
Copyright
Copyright © 2016-2024. The Stdlib Authors.