BIS_fnc_nearestNum

From Bohemia Interactive Community
Jump to navigation Jump to search
Introduced with Arma 2 version 1.00
  

Click on the images for descriptions

Introduced in

Game:
Arma 2
Version:
1.00

Description

Description:
Returns the provided set closest number to the target number.

Syntax

Syntax:
[values, value] call BIS_fnc_nearestNum
Parameters:
values: Array of Numbers - values to choose from
value: Number - the reference value
Return Value:
Number - the closest value

Examples

Example 1:
_closestValueTo4 = [[1,5,10], 4] call BIS_fnc_nearestNum; // returns 5

Additional Information

Execution:
call
Multiplayer:
-
See also:
BIS fnc randomNumrandom

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section