finite: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
m (Some wiki formatting)
 
(60 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1
|version1= 1.00


|1.00|= Game version
|game2= arma2
____________________________________________________________________________________________
|version2= 1.00


| [[true|True]], if number is finite (not infinite and a valid number) |DESCRIPTION=
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| [[Boolean]] <nowiki>=</nowiki> '''finite''' x |SYNTAX=
|game4= tkoh
|version4= 1.00


|p1= x: [[Number]] |PARAMETER1=
|game5= arma3
|version5= 0.50


| [[Boolean]] |RETURNVALUE=
|gr1= Math
____________________________________________________________________________________________
 
|x1= <pre>finite 10/0 .... result is false</pre> |EXAMPLE1=
|x1= <pre>?!finite 10/0 : hint "Infinite"</pre> |EXAMPLE1=


____________________________________________________________________________________________
|descr= Returns [[true]] if the provided number is finite (not infinite and a valid number).
{{ Feature | Informative |
* Maximum finite [[Number]] : 3.40282e+38
* Minimum finite [[Number]] : -3.40282e+38 }}


| |SEEALSO=
|s1= [[finite]] number


|p1= number: [[Number]]
|r1= [[Boolean]]
|x1= <sqf>finite 123; // returns true</sqf>
|x2= <sqf>finite log -1; // returns false</sqf>
|x3= <sqf>if (not finite log -1) then { hint "Infinite" };</sqf>
|seealso= [[a / b]]
}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
 
<dd class="notedate">Posted on 27 Sep, 2013
<dt><dt>
<dt class="note">'''[[User:Killzone_Kid|Killzone_Kid]]'''<dd class="note">
<dd class="notedate">Posted on 27 Sep, 2013</dd>
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt>
<dd class="note">
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:
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:
<code>//ArmA 2
<sqf>// Arma 2
[[hint]] [[str]] [[finite]] (10/0); //true ... O_o Huh????
hint str finite (10/0); // true ... O_o Huh????
[[hint]] [[str]] (10/0); //0 ... Weird, but that explains it.
hint str (10/0); // 0 ... Weird, but that explains it.
//ArmA 3
[[hint]] [[str]] [[finite]] (10/0); // Error Zero Divisor
[[hint]] [[str]] [[finite]] 10; //true
[[hint]] [[str]] [[finite]] 1000000000000000000000000000000000000000; //false</code>


// Arma 3
hint str finite (10/0); // true + Error Zero Divisor
hint str finite 10; // true
hint str finite 1000000000000000000000000000000000000000; // false</sqf>


<!-- Note Section END -->
</dl>
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|FINITE]]
[[Category:Scripting Commands ArmA|FINITE]]
[[Category:Command_Group:_Math|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 20:17, 13 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