| | @@ -9,7 +9,7 @@ |
| 9 | 9 | This report defines the language. It is short on purpose. Whatever it |
| 10 | 10 | doesn't allow, raz doesn't have. |
| 11 | 11 | |
| 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 |
| 13 | 13 | version changed. 2026-10.11 and 2026-10.12 are a thaw the owner chose, |
| 14 | 14 | for a language anyone can build again. They break programs written |
| 15 | 15 | for 2026-10.10 and before: for 2026-10.9, say, the report of compiler |
| | @@ -1217,7 +1217,7 @@ |
| 1217 | 1217 | | `List` | a generic singly linked list, `List(T)` | |
| 1218 | 1218 | | `Map` | a generic hash map, `Map(K, V; hash, eq)` | |
| 1219 | 1219 | | `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` | |
| 1221 | 1221 | | `Files` | an argument as a string, and a whole file read or written | |
| 1222 | 1222 | | `Opt` | a command line read through one table, by `getopt`'s rules with long options; its help and its mistakes | |
| 1223 | 1223 | |
| | @@ -1397,6 +1397,7 @@ |
| 1397 | 1397 | proc symlink*(target, path: []U8): INT; (* path made a link to target *) |
| 1398 | 1398 | proc readLink*(path: []U8): ([]U8, INT); (* what the link names, good until the next call *) |
| 1399 | 1399 | 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 *) |
| 1400 | 1401 | |
| 1401 | 1402 | proc openDir*(d: ^Dir; path: []U8): INT; |
| 1402 | 1403 | proc nextEntry*(d: ^Dir): ([]U8, BOOL); (* a name, good until the next call; false at the end *) |
| | @@ -1619,11 +1620,20 @@ |
| 1619 | 1620 | module Math; |
| 1620 | 1621 | const pi* = 3.141592653589793; |
| 1621 | 1622 | proc sqrt*(x: F64): F64; |
| 1623 | +proc pow*(x, y: F64): F64; (* x to the power y *) |
| 1622 | 1624 | 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 *) |
| 1623 | 1627 | proc exp*(x: F64): F64; |
| 1624 | 1628 | proc ln*(x: F64): F64; |
| 1629 | +proc log2*(x: F64): F64; |
| 1630 | +proc log10*(x: F64): F64; |
| 1625 | 1631 | proc sin*(x: F64): F64; |
| 1626 | 1632 | 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 *) |
| 1627 | 1637 | proc atan2*(y, x: F64): F64; (* the angle of (x, y) from the x axis, from -pi to pi *) |
| 1628 | 1638 | ``` |
| 1629 | 1639 | |
| | @@ -1893,6 +1903,9 @@ |
| 1893 | 1903 | - **2026-10.14.** The blank, `_`, drops a value or one of several |
| 1894 | 1904 | results (section 7.1); a call that drops a result is warned of |
| 1895 | 1905 | (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). |
| 1896 | 1909 | |
| 1897 | 1910 | ## Appendix A. What an implementation chooses |
| 1898 | 1911 | |