-
Notifications
You must be signed in to change notification settings - Fork 0
max
ffredyk edited this page Jul 23, 2026
·
1 revision
Arithmetic
Binary — a max b.
<number> max <number>
Returns the larger of two numbers. If equal, returns that value. Auto-unwraps shared values before comparing.
Compares two double values and returns the greater one. Equivalent to Math.Max(a, b). The host re-registers max with shared-value unwrapping.
_hp = _hp max 0; // never below 0
_damage = (_incoming - _armor) max 0; // no negative damage_best = _scoreA max _scoreB;
_budget = _requested max _minimum;// Clamp _value between _low and _high
_clamped = (_value max _low) min _high;
// Example: clamp health to [0, 100]
_hp = ((_hp + _heal) max 0) min 100;_findMax = {
params ["_arr"];
private _max = _arr select 0;
{ _max = _max max _x } forEach _arr;
_max
};
_result = [3, 7, 2, 9] call _findMax; // 9ReadOnly — pure computation, no side effects. Safe from any scheduler.
- Getting Started
- Language Guide
- Type System
- Control Flow
- Functions & Code
- Strings & Text
- Arrays & Collections
- Concurrency
- Promise System
- Thread Safety
- Host API & Embedding
- CLI Tool
- Bytecode Reference
- Multiplayer
- Syntax Sugar
- Optimization Guide
- Benchmarks
- count
- select
- pushBack
- append
- deleteAt
- deleteRange
- resize
- reverse
- sort
- find
- in
- forEach
- freeze
- thaw
- isFrozen
- currentScheduler
- clientOwner
- allSchedulers
- schedulerName
- schedulerExists
- schedulerBudget
- setSchedulerBudget
- fiberCount
- readyFiberCount
- waitingFiberCount
- schedulerLoad
- sendTo