@stdlib/assert-is-negative-finite
v0.1.1
Published
Test if a value is a number having a finite negative value.
Downloads
2
Readme
isNegativeFinite
Test if a value is a number having a finite negative value.
Installation
npm install @stdlib/assert-is-negative-finite
Usage
var isNegativeFinite = require( '@stdlib/assert-is-negative-finite' );
isNegativeFinite( value )
Tests if a value is a number having a finite negative value.
var Number = require( '@stdlib/number-ctor' );
var bool = isNegativeFinite( -5.0 );
// returns true
bool = isNegativeFinite( new Number( -5.0 ) );
// returns true
bool = isNegativeFinite( -3.14 );
// returns true
bool = isNegativeFinite( 5.0 );
// returns false
bool = isNegativeFinite( null );
// returns false
bool = isNegativeFinite( -1.0/0.0 );
// returns false
isNegativeFinite.isPrimitive( value )
Tests if a value is a primitive number having a finite negative value.
var Number = require( '@stdlib/number-ctor' );
var bool = isNegativeFinite.isPrimitive( -3.0 );
// returns true
bool = isNegativeFinite.isPrimitive( new Number( -3.0 ) );
// returns false
isNegativeFinite.isObject( value )
Tests if a value is a Number
object having a finite negative value.
var Number = require( '@stdlib/number-ctor' );
var bool = isNegativeFinite.isObject( -3.0 );
// returns false
bool = isNegativeFinite.isObject( new Number( -3.0 ) );
// returns true
Examples
var Number = require( '@stdlib/number-ctor' );
var isNegativeFinite = require( '@stdlib/assert-is-negative-finite' );
var bool = isNegativeFinite( -5.0 );
// returns true
bool = isNegativeFinite( new Number( -5.0 ) );
// returns true
bool = isNegativeFinite( -3.14 );
// returns true
bool = isNegativeFinite( 0.0 );
// returns false
bool = isNegativeFinite( 5.0 );
// returns false
bool = isNegativeFinite( '-5' );
// returns false
bool = isNegativeFinite( null );
// returns false
bool = isNegativeFinite( -1.0/0.0 );
// returns false
bool = isNegativeFinite( new Number( -1.0/0.0 ) );
// returns false
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.