isEqualTo – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code> +" to "<code>")
m (Text replacement - "Killzone Kid" to "Killzone_Kid")
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- Note Section BEGIN -->
<dl>
<dl>
<dd class="notedate">Posted on Apr 15, 2014 - 16:24</dd>
<dd class="notedate">Posted on Apr 15, 2014 - 16:24</dd>
<dt class="note">'''[[User:ffur2007slx2_5|ffur2007slx2_5]]'''<dd class="note">
<dt class="note">'''[[User:ffur2007slx2_5|ffur2007slx2_5]]'''<dd class="note">
(ArmA3 1.16) for multiple comparisons, we can use the example below for more accurate compare than [[BIS_fnc_arrayCompare]] or [[BIS_fnc_areEqual]]:
(ArmA3 1.16) for multiple comparisons, we can use the example below for more accurate compare than [[BIS_fnc_arrayCompare]] or [[BIS_fnc_areEqual]]:
<code>fnc_areEqual = {
<code style="display: block">fnc_areEqual = {
[[private]] ["_b","_var1","_var2"];
[[private]] ["_b","_var1","_var2"];
_b = [[true]];
_b = [[true]];
Line 17: Line 16:
["A","a","a"] [[call]] [[BIS_fnc_areEqual]]; // true
["A","a","a"] [[call]] [[BIS_fnc_areEqual]]; // true
</code>
</code>
<!-- Note Section END -->
</dd>  
</dd>  
</dl>
</dl>


Moved this note here, after testing performance of this solution, To compare, where BIS_fnc_areEqual which is pretty slow takes 0.66ms to complete, this ^^^^ one takes 333.65ms. [[User:Killzone Kid|Killzone Kid]] ([[User talk:Killzone Kid|talk]]) 13:39, 21 May 2015 (CEST)
Moved this note here, after testing performance of this solution, To compare, where BIS_fnc_areEqual which is pretty slow takes 0.66ms to complete, this ^^^^ one takes 333.65ms. [[User:Killzone_Kid|Killzone_Kid]] ([[User talk:Killzone_Kid|talk]]) 13:39, 21 May 2015 (CEST)

Latest revision as of 14:48, 12 March 2024

Posted on Apr 15, 2014 - 16:24
ffur2007slx2_5
(ArmA3 1.16) for multiple comparisons, we can use the example below for more accurate compare than BIS_fnc_arrayCompare or BIS_fnc_areEqual: fnc_areEqual = { private ["_b","_var1","_var2"]; _b = true; for [{_i = 1},{_i < (count _this) && _b},{_i = _i + 1}] do { _var1 = _this select (_i-1); _var2 = _this select _i; if (!(_var1 isEqualTo _var2)) then {_b = false;}; }; _b }; ["A","a","a"] call fnc_areEqual; // false ["A","a","a"] call BIS_fnc_areEqual; // true

Moved this note here, after testing performance of this solution, To compare, where BIS_fnc_areEqual which is pretty slow takes 0.66ms to complete, this ^^^^ one takes 333.65ms. Killzone_Kid (talk) 13:39, 21 May 2015 (CEST)