Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/BUILTINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,4 +618,4 @@ receiver.

| Name | Signature | Description |
|------|-----------|-------------|
| `__borrow_guard_selftest` | `__borrow_guard_selftest of [args...]` | **Not a user builtin.** A planted fault validating the #548 borrow-scan guard: registered only in ASan builds when `EIGS_BORROW_GUARD_SELFTEST` is set, it deliberately returns a borrowed direct child past `VM_BORROW_SCAN_CAP` so the suite can prove the guard aborts loudly (naming the builtin) instead of letting a missed compensating incref become a silent use-after-free. Absent from release builds and from sanitizer builds without the opt-in env var (fuzzers must never reach a deliberate abort). |
| `__borrow_guard_selftest` | `__borrow_guard_selftest of [args...]` | **Not a user builtin.** A planted fault validating the #548 borrow-scan guard: registered only in ASan builds when `EIGS_BORROW_GUARD_SELFTEST` is set, it deliberately returns a borrowed direct child past `VM_BORROW_SCAN_CAP` so the suite can prove the guard aborts loudly (naming the builtin) instead of letting a missed compensating incref become a silent use-after-free. Absent from release builds and from sanitizer builds without the opt-in env var (fuzzers must never reach a deliberate abort). |
3 changes: 2 additions & 1 deletion docs/STDLIB.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ signature comment above each function (e.g., `# clamp of [value, lo, hi]`).
| `lcm` | `lcm of [a, b]` | Least common multiple |
| `argmax` | `argmax of list` | Index of the largest element (first on ties, -1 if empty) |
| `argmin` | `argmin of list` | Index of the smallest element (first on ties, -1 if empty) |

| `log2` | `log2 of x` | base-2 logarithm |
| `log10` | `log10 of x` | base-10 logarithm |
### lib/list.eigs — Functional List Operations

| Function | Signature | Description |
Expand Down
9 changes: 9 additions & 0 deletions lib/math.eigs
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,12 @@ define argmin(items) as:
best_val is items[i]
best_idx is i
return best_idx

# ---- log2: base-2 logarithm ----
define log2(x) as:
return (log of x) / 0.6931471805599453

# ---- log10: base-10 logarithm ----
define log10(x) as:
return (log of x) / 2.302585092994046

Loading