Compute the sine of a single-precision floating-point number (in degrees).
var sindf = require( '@stdlib/math/base/special/sindf' );Computes the sine of a single-precision floating-point number (in degrees).
var v = sindf( 0.0 );
// returns 0.0
v = sindf( 30.0 );
// returns ~0.5
v = sindf( 90.0 );
// returns 1.0
v = sindf( NaN );
// returns NaNvar uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var sindf = require( '@stdlib/math/base/special/sindf' );
var opts = {
'dtype': 'float32'
};
var x = uniform( 100, -180.0, 180.0, opts );
logEachMap( 'sindf(%0.4f) = %0.4f', x, sindf );#include "stdlib/math/base/special/sindf.h"Computes the sine of a single-precision floating-point number (in degrees).
float out = stdlib_base_sindf( 0.0f );
// returns 0.0f
out = stdlib_base_sindf( 30.0f );
// returns ~0.5fThe function accepts the following arguments:
- x:
[in] floatinput value.
float stdlib_base_sindf( const float x );#include "stdlib/math/base/special/sindf.h"
#include <stdio.h>
int main( void ) {
const float x[] = { 0.0f, 30.0f, 45.0f, 60.0f, 90.0f };
float y;
int i;
for ( i = 0; i < 5; i++ ) {
y = stdlib_base_sindf( x[ i ] );
printf( "sindf(%f) = %f\n", x[ i ], y );
}
}