Compute the secant of a single-precision floating-point number (in degrees).
var secdf = require( '@stdlib/math/base/special/secdf' );Computes the secant of a single-precision floating-point number (in degrees).
var v = secdf( 30.0 );
// returns ~1.15
v = secdf( 45.0 );
// returns ~1.41
v = secdf( 60.0 );
// returns ~2.0
v = secdf( 90.0 );
// returns Infinity
v = secdf( 0.0 );
// returns 1.0
v = secdf( NaN );
// returns NaNvar uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var secdf = require( '@stdlib/math/base/special/secdf' );
var opts = {
'dtype': 'float32'
};
var x = uniform( 100, -180.0, 180.0, opts );
logEachMap( 'secdf(%0.4f) = %0.4f', x, secdf );#include "stdlib/math/base/special/secdf.h"Computes the secant of a single-precision floating-point number (in degrees).
float out = stdlib_base_secdf( 30.0f );
// returns ~1.15f
out = stdlib_base_secdf( 45.0f );
// returns ~1.41fThe function accepts the following arguments:
- x:
[in] floatinput value.
float stdlib_base_secdf( const float x );#include "stdlib/math/base/special/secdf.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_secdf( x[ i ] );
printf( "secdf(%f) = %f\n", x[ i ], y );
}
}