Function isFinite #

Test whether a value is finite.

Operates elementwise on Array and Matrix values. To test if all entries of an Array or Matrix are finite, use isBounded.

Syntax #

math.isFinite(x)

Parameters #

Parameter Type Description
x number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix Value to be tested

Returns #

Type Description
boolean | Array | Matrix  

Throws #

Type | Description —- | ———–

Examples #

math.isFinite(0)                        // returns true
math.isFinite(NaN)                      // returns false
math.isFinite(math.bignumber(Infinity)) // returns false
math.isFinite(math.fraction(1,3))       // returns true
math.isFinite(math.complex('2 - 4i'))   // returns true
math.isFinite(-10000000000000000n)      // returns true
math.isFinite(undefined)                // returns false
math.isFinite(null)                     // returns false
math.isFinite([0.001, -3n, 0])          // Array [true, true, true]
math.isFinite([2, -Infinity, -3])       // Array [true, false, true]

See also #

isBounded isNumeric, isPositive, isNegative, isNaN

Fork me on GitHub