time-to-botec/squiggle/node_modules/@stdlib/assert/is-cube-number/README.md
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

2.8 KiB

isCubeNumber

Test if a value is a cube number.

A cube number is defined as an integer value which is the cube of an integer.

Usage

var isCubeNumber = require( '@stdlib/assert/is-cube-number' );

isCubeNumber( value )

Tests if a value is a cube number.

var Number = require( '@stdlib/number/ctor' );

var bool = isCubeNumber( 8.0 );
// returns true

bool = isCubeNumber( new Number( 8.0 ) );
// returns true

bool = isCubeNumber( 3.14 );
// returns false

bool = isCubeNumber( -5.0 );
// returns false

bool = isCubeNumber( NaN );
// returns false

bool = isCubeNumber( null );
// returns false

isCubeNumber.isPrimitive( value )

Tests if a value is a primitive cube number.

var Number = require( '@stdlib/number/ctor' );

var bool = isCubeNumber.isPrimitive( 8.0 );
// returns true

bool = isCubeNumber.isPrimitive( new Number( 8.0 ) );
// returns false

isCubeNumber.isObject( value )

Tests if a value is a Number object having a value which is a cube number.

var Number = require( '@stdlib/number/ctor' );

var bool = isCubeNumber.isObject( 8.0 );
// returns false

bool = isCubeNumber.isObject( new Number( 8.0 ) );
// returns true

Examples

var Number = require( '@stdlib/number/ctor' );
var isCubeNumber = require( '@stdlib/assert/is-cube-number' );

var bool = isCubeNumber( 8.0 );
// returns true

bool = isCubeNumber( new Number( 8.0 ) );
// returns true

bool = isCubeNumber( 0.0 );
// returns true

bool = isCubeNumber( 1.0 );
// returns true

bool = isCubeNumber( 3.14 );
// returns false

bool = isCubeNumber( -5.0 );
// returns false

bool = isCubeNumber( NaN );
// returns false

bool = isCubeNumber( '0.5' );
// returns false

bool = isCubeNumber( null );
// returns false