0.1.0 • Published 23 days ago

@stdlib/math-base-special-asinf v0.1.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
23 days ago

asinf

NPM version Build Status Coverage Status

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 );
    }
}

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

Chat


Copyright

Copyright © 2016-2024. The Stdlib Authors.