isinfinity

isinfinity, function

def const pure isinfinity(n: number): boolean
def const pure isinfinity(n: double): boolean

Returns true when n is a floating-point infinity.

Examples

table T = extend.range(3)

T.Label = if T.N == 1 then "finite" else if T.N == 2 then "infinite" else "nan"
T.X = if T.N == 1 then 1 else if T.N == 2 then 2e38 * 2e38 else 0 / 0

show table "Infinity check" with
  T.Label
  isinfinity(T.X) as "IsInfinity"

This outputs the following table:

Label IsInfinity
finite false
infinite true
nan false

See also

User Contributed Notes
0 notes + add a note