finite: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Update description)
(0 division is not a good example of infinite in Arma)
Line 17: Line 17:
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <code>[[finite]] 10/0; {{cc|returns false}}</code> |EXAMPLE1=
|x1= <code>[[finite]] 123; {{cc|returns true}}</code> |EXAMPLE1=
 
|x2= <code>[[finite]] [[log]] -1; {{cc|returns false}}</code> |EXAMPLE2=
|x2= <code>[[if]] ([[not]] [[finite]] 10/0) [[then]] { [[hint]] "Infinite"; };</code> |EXAMPLE2=
|x3= <code>[[if]] ([[not]] [[finite]] [[log]] -1) [[then]] { [[hint]] "Infinite" };</code> |EXAMPLE3=
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 38: Line 38:


{{cc|{{arma3}}}}
{{cc|{{arma3}}}}
[[hint]] [[str]] [[finite]] (10/0); {{cc|Error Zero Divisor}}
[[hint]] [[str]] [[finite]] (10/0); {{cc|true + Error Zero Divisor}}
[[hint]] [[str]] [[finite]] 10; {{cc|true}}
[[hint]] [[str]] [[finite]] 10; {{cc|true}}
[[hint]] [[str]] [[finite]] 1000000000000000000000000000000000000000; {{cc|false}}</code>
[[hint]] [[str]] [[finite]] 1000000000000000000000000000000000000000; {{cc|false}}</code>

Revision as of 08:21, 5 September 2019

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Returns true if the provided number is finite (not infinite and a valid number).
Groups:
Uncategorised

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:
See also needed

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

Notes

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

Bottom Section