Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Feb 24, 2024
1 parent 271f7e0 commit df50c03
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 61 deletions.
26 changes: 10 additions & 16 deletions is-negative-finite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var isNegativeFinite = require( '@stdlib/assert/is-negative-finite' );

#### isNegativeFinite( value )

Tests if a `value` is a `number` having a finite negative value.
Tests if a value is a number having a finite negative value.

<!-- eslint-disable no-new-wrappers -->

Expand All @@ -54,13 +54,13 @@ bool = isNegativeFinite( 5.0 );
bool = isNegativeFinite( null );
// returns false

bool = isNegativeFinite( Number.NEGATIVE_INFINITY );
bool = isNegativeFinite( -1.0/0.0 );
// returns false
```

#### isNegativeFinite.isPrimitive( value )

Tests if a `value` is a primitive `number` having a finite negative value.
Tests if a value is a primitive number having a finite negative value.

<!-- eslint-disable no-new-wrappers -->

Expand All @@ -76,7 +76,7 @@ bool = isNegativeFinite.isPrimitive( new Number( -3.0 ) );

#### isNegativeFinite.isObject( value )

Tests if a `value` is a `Number` object having a finite negative value.
Tests if a value is a `Number` object having a finite negative value.

<!-- eslint-disable no-new-wrappers -->

Expand Down Expand Up @@ -126,6 +126,12 @@ bool = isNegativeFinite( '-5' );

bool = isNegativeFinite( null );
// returns false

bool = isNegativeFinite( -1.0/0.0 );
// returns false

bool = isNegativeFinite( new Number( -1.0/0.0 ) );
// returns false
```

</section>
Expand All @@ -136,12 +142,6 @@ bool = isNegativeFinite( null );

<section class="related">

* * *

## See Also

- <span class="package-name">[`@stdlib/assert/is-number`][@stdlib/assert/is-number]</span><span class="delimiter">: </span><span class="description">test if a value is a number.</span>

</section>

<!-- /.related -->
Expand All @@ -150,12 +150,6 @@ bool = isNegativeFinite( null );

<section class="links">

<!-- <related-links> -->

[@stdlib/assert/is-number]: https://github.com/stdlib-js/assert/tree/main/is-number

<!-- </related-links> -->

</section>

<!-- /.links -->
20 changes: 10 additions & 10 deletions is-negative-finite/benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

/* eslint-disable no-undefined, no-empty-function */
/* eslint-disable no-empty-function */

'use strict';

Expand All @@ -43,12 +43,12 @@ bench( pkg+'::primitives', function benchmark( b ) {
3.14,
-5.0,
-4.0,
Number.NEGATIVE_INFINITY,
-1.0/0.0,
NaN,
true,
false,
null,
undefined
void 0
];

b.tic();
Expand Down Expand Up @@ -78,7 +78,7 @@ bench( pkg+'::objects', function benchmark( b ) {
new Number( 2.0 ),
new Number( -3.0 ),
new Number( 3.14 ),
new Number( Number.NEGATIVE_INFINITY )
new Number( -1.0/0.0 )
];

b.tic();
Expand Down Expand Up @@ -108,12 +108,12 @@ bench( pkg+'::primitives:isPrimitive', function benchmark( b ) {
3.14,
-5.0,
-4.0,
Number.NEGATIVE_INFINITY,
-1.0/0.0,
NaN,
true,
false,
null,
undefined
void 0
];

b.tic();
Expand Down Expand Up @@ -143,7 +143,7 @@ bench( pkg+'::objects:isPrimitive', function benchmark( b ) {
new Number( 2.0 ),
new Number( -3.0 ),
new Number( 3.14 ),
new Number( Number.NEGATIVE_INFINITY )
new Number( -1.0/0.0 )
];

b.tic();
Expand Down Expand Up @@ -173,12 +173,12 @@ bench( pkg+'::primitives:isObject', function benchmark( b ) {
3.14,
-5.0,
-4.0,
Number.NEGATIVE_INFINITY,
-1.0/0.0,
NaN,
true,
false,
null,
undefined
void 0
];

b.tic();
Expand Down Expand Up @@ -208,7 +208,7 @@ bench( pkg+'::objects:isObject', function benchmark( b ) {
new Number( 2.0 ),
new Number( -3.0 ),
new Number( 3.14 ),
new Number( Number.NEGATIVE_INFINITY )
new Number( -1.0/0.0 )
];

b.tic();
Expand Down
18 changes: 9 additions & 9 deletions is-negative-finite/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Returns
-------
bool: boolean
Boolean indicating whether value is a finite negative number.
Boolean indicating whether a value is a finite negative number.

Examples
--------
Expand All @@ -24,9 +24,9 @@
false
> bool = {{alias}}( null )
false
> bool = {{alias}}( Number.NEGATIVE_INFINITY )
> bool = {{alias}}( -1.0/0.0 )
false
> bool = {{alias}}( new Number( Number.NEGATIVE_INFINITY ) )
> bool = {{alias}}( new Number( -1.0/0.0 ) )
false


Expand All @@ -41,7 +41,7 @@
Returns
-------
bool: boolean
Boolean indicating whether value is a number primitive having a finite
Boolean indicating whether a value is a number primitive having a finite
negative value.

Examples
Expand All @@ -50,9 +50,9 @@
true
> bool = {{alias}}.isPrimitive( new Number( -3.0 ) )
false
> var bool = {{alias}}.isPrimitive( Number.NEGATIVE_INFINITY )
> var bool = {{alias}}.isPrimitive( -1.0/0.0 )
false
> bool = {{alias}}.isPrimitive( new Number( Number.NEGATIVE_INFINITY ) )
> bool = {{alias}}.isPrimitive( new Number( -1.0/0.0 ) )
false


Expand All @@ -67,7 +67,7 @@
Returns
-------
bool: boolean
Boolean indicating whether value is a number object having a finite
Boolean indicating whether a value is a number object having a finite
negative value.

Examples
Expand All @@ -76,9 +76,9 @@
false
> bool = {{alias}}.isObject( new Number( -3.0 ) )
true
> bool = {{alias}}.isObject( Number.NEGATIVE_INFINITY )
> bool = {{alias}}.isObject( -1.0/0.0 )
false
> bool = {{alias}}.isObject( new Number( Number.NEGATIVE_INFINITY ) )
> bool = {{alias}}.isObject( new Number( -1.0/0.0 ) )
false

See Also
Expand Down
10 changes: 5 additions & 5 deletions is-negative-finite/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interface isNegativeFinite {
* // returns false
*
* @example
* var bool = isNegativeFinite( Number.NEGATIVE_INFINITY );
* var bool = isNegativeFinite( -1.0/0.0 );
* // returns false
*/
( value: number | Number ): value is number | Number;
Expand All @@ -74,7 +74,7 @@ interface isNegativeFinite {
* Tests if a value is a number object having a negative value.
*
* @param value - value to test
* @returns boolean indicating if a value is a number object having a negative value
* @returns boolean indicating if a value is a number object having a finite negative value
*
* @example
* var bool = isNegativeFinite.isObject( -3.0 );
Expand All @@ -91,7 +91,7 @@ interface isNegativeFinite {
* Tests if a value is a negative number.
*
* @param value - value to test
* @returns boolean indicating whether value is a negative number
* @returns boolean indicating whether value is a finite negative number
*
* @example
* var bool = isNegativeFinite( -5.0 );
Expand Down Expand Up @@ -122,11 +122,11 @@ interface isNegativeFinite {
* // returns true
*
* @example
* var bool = isNegativeFinite.isPrimitive( Number.NEGATIVE_INFINITY );
* var bool = isNegativeFinite.isPrimitive( -1.0/0.0 );
* // returns false
*
* @example
* var bool = isNegativeFinite.isObject( new Number( Number.NEGATIVE_INFINITY ) );
* var bool = isNegativeFinite.isObject( new Number( -1.0/0.0 ) );
* // returns false
*/
declare var isNegativeFinite: isNegativeFinite;
Expand Down
4 changes: 2 additions & 2 deletions is-negative-finite/examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ console.log( isNegativeFinite( '-5' ) );
console.log( isNegativeFinite( null ) );
// => false

console.log( isNegativeFinite( Number.NEGATIVE_INFINITY ) );
console.log( isNegativeFinite( -1.0/0.0 ) );
// => false

console.log( isNegativeFinite( new Number(Number.NEGATIVE_INFINITY) ) );
console.log( isNegativeFinite( new Number( -1.0/0.0 ) ) );
// => false
10 changes: 4 additions & 6 deletions is-negative-finite/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'use strict';

/**
* Test if a value is a negative finite number.
* Test if a value is a finite negative number.
*
* @module @stdlib/assert/is-negative-finite
*
Expand All @@ -41,11 +41,10 @@
* bool = isNegativeFinite( null );
* // returns false
*
* bool = isNegativeFinite( Number.NEGATIVE_INFINITY );
* bool = isNegativeFinite( -1.0/0.0 );
* // returns false
*
* @example
* // Use interface to check for finite negative number primitives...
* var isNegativeFinite = require( '@stdlib/assert/is-negative-finite' ).isPrimitive;
*
* var bool = isNegativeFinite( -3.0 );
Expand All @@ -54,11 +53,10 @@
* bool = isNegativeFinite( new Number( -3.0 ) );
* // returns false
*
* bool = isNegativeFinite( new Number( Number.NEGATIVE_INFINITY ) );
* bool = isNegativeFinite( new Number( -1.0/0.0 ) );
* // returns false
*
* @example
* // Use interface to check for negative number objects...
* var isNegativeFinite = require( '@stdlib/assert/is-negative-finite' ).isObject;
*
* var bool = isNegativeFinite( -3.0 );
Expand All @@ -67,7 +65,7 @@
* bool = isNegativeFinite( new Number( -3.0 ) );
* // returns true
*
* bool = isNegativeFinite( new Number( Number.NEGATIVE_INFINITY ) );
* bool = isNegativeFinite( new Number( -1.0/0.0 ) );
* // returns false
*/

Expand Down
5 changes: 3 additions & 2 deletions is-negative-finite/lib/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// MODULES //

var isNumber = require( './../../is-number' ).isObject;
var isFinite = require( './../../is-finite' ).isObject; // eslint-disable-line stdlib/no-redeclare
var NINF = require( '@stdlib/constants/float64/ninf' );


// MAIN //
Expand Down Expand Up @@ -51,7 +51,8 @@ var isFinite = require( './../../is-finite' ).isObject; // eslint-disable-line s
function isNegativeFinite( value ) {
return (
isNumber( value ) &&
value.valueOf() < 0.0 && isFinite(value)
value.valueOf() < 0.0 &&
value.valueOf() > NINF
);
}

Expand Down
11 changes: 6 additions & 5 deletions is-negative-finite/lib/primitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
// MODULES //

var isNumber = require( './../../is-number' ).isPrimitive;
var isFinite = require( './../../is-finite' ).isPrimitive; // eslint-disable-line stdlib/no-redeclare
var NINF = require( '@stdlib/constants/float64/ninf' );


// MAIN //

/**
* Tests if a value is a number primitive having finite a negative value.
* Tests if a value is a number primitive having a finite negative value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a finite negative value
Expand All @@ -37,21 +37,22 @@ var isFinite = require( './../../is-finite' ).isPrimitive; // eslint-disable-lin
* // returns true
*
* @example
* var bool = isNegativeFinite( Number.NEGATIVE_INFINITY );
* var bool = isNegativeFinite( -1.0/0.0 );
* // returns false
*
* @example
* var bool = isNegativeFinite( new Number( -3.0 ) );
* // returns false
*
* @example
* var bool = isNegativeFinite( new Number( Number.NEGATIVE_INFINITY ) );
* var bool = isNegativeFinite( new Number( -1.0/0.0 ) );
* // returns false
*/
function isNegativeFinite( value ) {
return (
isNumber( value ) &&
value < 0.0 && isFinite(value)
value < 0.0 &&
value > NINF
);
}

Expand Down
6 changes: 4 additions & 2 deletions is-negative-finite/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stdlib/assert/is-negative-number",
"name": "@stdlib/assert/is-negative-finite",
"version": "0.0.0",
"description": "Test if a value is a number having a negative value.",
"description": "Test if a value is a number having a finite negative value.",
"license": "Apache-2.0",
"author": {
"name": "The Stdlib Authors",
Expand Down Expand Up @@ -63,6 +63,8 @@
"is",
"isnumber",
"isnumeric",
"finite",
"isfinite",
"type",
"check",
"primitive",
Expand Down
Loading

0 comments on commit df50c03

Please sign in to comment.