-
Notifications
You must be signed in to change notification settings - Fork 0
div
ffredyk edited this page Jul 23, 2026
·
1 revision
Arithmetic
Binary — left operand / right operand.
<number> / <number>
Divides the left operand by the right operand. Returns the quotient as a floating-point number. Auto-unwraps shared values before operating.
Division by zero throws SqTypeError.
Performs double floating-point division. The host checks for zero divisor and throws an error if detected. The result is always a double — integer division is not a separate operation.
_result = 10 / 3; // 3.333...
_half = _value / 2;
_ratio = _current / _max;_safe = if (_divisor != 0) then {
_value / _divisor
} else {
0
};shared _total = 100;
_avg = get _total / _count;-
SqTypeError— thrown when divisor is0(or0.0).
Not atomic. Regular division on primitives is thread-safe.
- 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