@stdlib/math-base-special-atanf
v0.1.0
Published
Compute the arctangent of a single-precision floating-point number.
Downloads
52
Readme
atanf
Compute the arctangent of a single-precision floating-point number.
Installation
npm install @stdlib/math-base-special-atanf
Usage
var atanf = require( '@stdlib/math-base-special-atanf' );
atanf( x )
Computes the arctangent of a single-precision floating-point number (in radians).
var v = atanf( 0.0 );
// returns 0.0
v = atanf( -3.14/4.0 );
// returns ~-0.666
Examples
var linspace = require( '@stdlib/array-base-linspace' );
var atanf = require( '@stdlib/math-base-special-atanf' );
var x = linspace( -1.0, 1.0, 100 );
var i;
for ( i = 0; i < x.length; i++ ) {
console.log( atanf( x[ i ] ) );
}
C APIs
Usage
#include "stdlib/math/base/special/atanf.h"
stdlib_base_atanf( x )
Computes the arctangent of a single-precision floating-point number (in radians).
float out = stdlib_base_atanf( 0.0f );
// returns 0.0f
out = stdlib_base_atanf( -3.14f/4.0f );
// returns ~-0.666f
The function accepts the following arguments:
- x:
[in] float
input value (in radians).
float stdlib_base_atanf( const float x );
Examples
#include "stdlib/math/base/special/atanf.h"
#include <stdio.h>
int main( void ) {
const float x[] = { -1000.0f, -777.78f, -555.56f, -333.33f, -111.11f, 111.11f, 333.33f, 555.56f, 777.78f, 1000.0f };
float v;
int i;
for ( i = 0; i < 10; i++ ) {
v = stdlib_base_atanf( x[ i ] );
printf( "atan(%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
Copyright
Copyright © 2016-2024. The Stdlib Authors.