Compute the arccosine of a single-precision floating-point number.
var acosf = require( '@stdlib/math/base/special/acosf' );
Computes the arccosine of a single-precision floating-point number (in radians).
var v = acosf( 1.0 );
// returns 0.0
v = acosf( 0.707 );
// returns ~0.7855
var linspace = require( '@stdlib/array/base/linspace' );
var acosf = require( '@stdlib/math/base/special/acosf' );
var x = linspace( -1.0, 1.0, 100 );
var i;
for ( i = 0; i < x.length; i++ ) {
console.log( acosf( x[ i ] ) );
}
#include "stdlib/math/base/special/acosf.h"
Computes the arccosine of a single-precision floating-point number (in radians).
float out = stdlib_base_acosf( 1.0f );
// returns 0.0f
out = stdlib_base_acosf( 0.707f );
// returns ~0.7855f
The function accepts the following arguments:
- x:
[in] float
input value (in radians).
float stdlib_base_acosf( const float x );
#include "stdlib/math/base/special/acosf.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_acosf( x[ i ] );
printf( "acos(%f) = %f\n", x[ i ], v );
}
}