finite: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<dd class="notedate">Posted on ([^<>]+) " to "<dd class="notedate">Posted on $1</dd> ")
m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(37 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma1
|game1= arma1
|version1= 1.00


|1.00
|game2= arma2
|version2= 1.00
 
|game3= arma2oa
|version3= 1.50
 
|game4= tkoh
|version4= 1.00
 
|game5= arma3
|version5= 0.50


|gr1= Math
|gr1= Math


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


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


|p1= number: [[Number]]
|p1= number: [[Number]]


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


<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->


<dt><dt>
<dd class="notedate">Posted on 27 Sep, 2013</dd>
<dd class="notedate">Posted on 27 Sep, 2013</dd>
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt>
<dd class="note">
<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>{{cc|{{arma2}}}}
<sqf>
[[hint]] [[str]] [[finite]] (10/0); {{cc|true ... O_o Huh????}}
// Arma 2
[[hint]] [[str]] (10/0); {{cc|0 ... Weird, but that explains it.}}
hint str finite (10/0); // true ... O_o Huh????
hint str (10/0); // 0 ... Weird, but that explains it.


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


<!-- Note Section END -->
</dl>
</dl>
[[Category:Scripting Commands|FINITE]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}

Latest revision as of 19:42, 3 September 2024

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