asinf

Compute the arcsine of a single-precision floating-point number.

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 );
    }
}
Did you find this page helpful?