Reference › Function reference › Platform

Platform.spells.finiteNonNegative

dependency

Call as

Platform.spells.finiteNonNegative(value)

Record the dependency Platform.spells.finiteNonNegative, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.

What it does

Returns true when value is a nonnegative number that is not NaN or infinity, and false for anything else.

Arguments

NameTypeWhat it does
valueanyValue to test.

Returns

1booleanTrue when value is a finite number of at least zero.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

It reads no game API directly.

How the addon calls it

Source

Platform/spells.lua, line 490. Read only in game; Duplicate makes an editable copy.

Platform.spells.finiteNonNegative(value)
    return type(value)=="number" and value==value and value>=0 and value~=math.huge

Back to Function reference