finite: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z0-9_]+)\]\]([^ ]*)<\/code>" to "<code>$1$2$3</code>")
Line 29: Line 29:
|r1= [[Boolean]]
|r1= [[Boolean]]


|x1= <code>[[finite]] 123; {{cc|returns true}}</code>
|x1= <code>finite 123; {{cc|returns true}}</code>
|x2= <code>[[finite]] [[log]] -1; {{cc|returns false}}</code>
|x2= <code>finite [[log]] -1; {{cc|returns false}}</code>
|x3= <code>[[if]] ([[not]] [[finite]] [[log]] -1) [[then]] { [[hint]] "Infinite" };</code>
|x3= <code>if ([[not]] [[finite]] [[log]] -1) [[then]] { [[hint]] "Infinite" };</code>


|seealso= [[a / b]]
|seealso= [[a / b]]

Revision as of 12:02, 12 May 2022

Hover & click on the images for description

Description

Description:
Returns true if the provided number is finite (not infinite and a valid number).
  • Maximum finite Number : 3.40282e+38
  • Minimum finite Number : -3.40282e+38
Groups:
Math

Syntax

Syntax:
finite number
Parameters:
number: Number
Return Value:
Boolean

Examples

Example 1:
finite 123; // returns true
Example 2:
finite log -1; // returns false
Example 3:
if (not finite log -1) then { hint "Infinite" };

Additional Information

See also:
a / b

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Posted on 27 Sep, 2013
Killzone_Kid
Don't get high hopes with this command thinking what a great way of catching divisions by zero, the command is pretty useless in this respect: // Arma 2 hint str finite (10/0); // true ... O_o Huh???? hint str (10/0); // 0 ... Weird, but that explains it. // Arma 3 hint str finite (10/0); // true + Error Zero Divisor hint str finite 10; // true hint str finite 1000000000000000000000000000000000000000; // false