@stdlib/math-base-assert-is-finitef
v0.2.2
Published
Test if a single-precision floating-point numeric value is finite.
Downloads
16
Readme
isfinitef
Test if a single-precision floating-point numeric value is finite.
Installation
npm install @stdlib/math-base-assert-is-finitef
Usage
var isfinitef = require( '@stdlib/math-base-assert-is-finitef' );
isfinitef( x )
Tests if a single-precision floating-point numeric
value is finite.
var bool = isfinitef( 3.14 );
// returns true
bool = isfinitef( Infinity );
// returns false
bool = isfinitef( -Infinity );
// returns false
bool = isfinitef( NaN );
// returns false
Examples
var PINF = require( '@stdlib/constants-float32-pinf' );
var NINF = require( '@stdlib/constants-float32-ninf' );
var isfinitef = require( '@stdlib/math-base-assert-is-finitef' );
var bool = isfinitef( 5.0 );
// returns true
bool = isfinitef( -2.0e32 );
// returns true
bool = isfinitef( PINF );
// returns false
bool = isfinitef( NINF );
// returns false
bool = isfinitef( NaN );
// returns false
See Also
@stdlib/math-base/assert/is-infinitef
: test if a single-precision floating-point numeric value is infinite.
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
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.