raz / commit 66b32efe

commit
66b32efe3a4a88d3a7a195c42fb752a2eade4777
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
9ca6cfc3
Report 2026-10.15: more of Math, and Sys.space

Math gains pow, ceil, round, log2, log10, tan, asin, acos and atan,
the inverses that sol and its kind need; Sys gains space, the bytes
free and in all on a file system. By the owner's word.

patch · log

1 file changed, +15 -2

doc/raz.md (history) modified +15 -2

@@ -9,7 +9,7 @@
99 This report defines the language. It is short on purpose. Whatever it
1010 doesn't allow, raz doesn't have.
1111
12-This is version 2026-10.14 of the report; section 12 says what each
12+This is version 2026-10.15 of the report; section 12 says what each
1313 version changed. 2026-10.11 and 2026-10.12 are a thaw the owner chose,
1414 for a language anyone can build again. They break programs written
1515 for 2026-10.10 and before: for 2026-10.9, say, the report of compiler
@@ -1217,7 +1217,7 @@
12171217 | `List` | a generic singly linked list, `List(T)` |
12181218 | `Map` | a generic hash map, `Map(K, V; hash, eq)` |
12191219 | `Sort` | sorting a slice in place, `Sort(T; less)` |
1220-| `Math` | `sqrt`, `floor`, `sin`, `cos`, `atan2`, `exp`, `ln` and `pi`, for `F64` |
1220+| `Math` | roots, powers, logarithms, rounding and trigonometry, and `pi`, for `F64` |
12211221 | `Files` | an argument as a string, and a whole file read or written |
12221222 | `Opt` | a command line read through one table, by `getopt`'s rules with long options; its help and its mistakes |
12231223
@@ -1397,6 +1397,7 @@
13971397 proc symlink*(target, path: []U8): INT; (* path made a link to target *)
13981398 proc readLink*(path: []U8): ([]U8, INT); (* what the link names, good until the next call *)
13991399 proc info*(path: []U8): (Info, INT); (* following a symbolic link *)
1400+proc space*(path: []U8): (I64, I64, INT); (* the bytes free and in all on path's file system *)
14001401
14011402 proc openDir*(d: ^Dir; path: []U8): INT;
14021403 proc nextEntry*(d: ^Dir): ([]U8, BOOL); (* a name, good until the next call; false at the end *)
@@ -1619,11 +1620,20 @@
16191620 module Math;
16201621 const pi* = 3.141592653589793;
16211622 proc sqrt*(x: F64): F64;
1623+proc pow*(x, y: F64): F64; (* x to the power y *)
16221624 proc floor*(x: F64): F64;
1625+proc ceil*(x: F64): F64;
1626+proc round*(x: F64): F64; (* to the nearest whole number; a half away from 0 *)
16231627 proc exp*(x: F64): F64;
16241628 proc ln*(x: F64): F64;
1629+proc log2*(x: F64): F64;
1630+proc log10*(x: F64): F64;
16251631 proc sin*(x: F64): F64;
16261632 proc cos*(x: F64): F64;
1633+proc tan*(x: F64): F64;
1634+proc asin*(x: F64): F64; (* from -pi/2 to pi/2 *)
1635+proc acos*(x: F64): F64; (* from 0 to pi *)
1636+proc atan*(x: F64): F64; (* from -pi/2 to pi/2 *)
16271637 proc atan2*(y, x: F64): F64; (* the angle of (x, y) from the x axis, from -pi to pi *)
16281638 ```
16291639
@@ -1893,6 +1903,9 @@
18931903 - **2026-10.14.** The blank, `_`, drops a value or one of several
18941904 results (section 7.1); a call that drops a result is warned of
18951905 (section 10).
1906+- **2026-10.15.** `Math` gains `pow`, `ceil`, `round`, `log2`,
1907+ `log10`, `tan`, `asin`, `acos` and `atan`; `Sys` gains `space`
1908+ (section 11).
18961909
18971910 ## Appendix A. What an implementation chooses
18981911