-
Notifications
You must be signed in to change notification settings - Fork 0
log
ffredyk edited this page Jul 23, 2026
·
1 revision
Math
Unary — log <number>.
log <number>
Returns the natural logarithm (base e) of a number. Input is clamped to ε (machine epsilon, ~2.22e-16) as a minimum — zero or negative inputs return a very large negative number instead of throwing. Auto-unwraps shared values.
Calls Math.Log(max(epsilon, x)). The clamping prevents errors from zero/negative inputs. This matches the safety-oriented behavior of the SQ# math library.
log 1; // 0
log 2.71828; // ~1
log 10; // 2.302...
// Decay constant
_k = log 2 / _halfLife;
// Log-scale comparison
if (log _a > log _b) then { ... }; // same as a > b for positive
// Information / entropy
_entropy = -_p * log _p;ReadOnly — pure computation. 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