You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/SPECIFICATION.html
+14-12Lines changed: 14 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -558,31 +558,31 @@
558
558
559
559
- `IN(ANY: value, TNS: tensor):INT` ; returns `1` if `value` is equal to any element of `tensor` (using the language's equality semantics), otherwise `0`.
560
560
561
-
### 12.2 Arithmetic (`INT` only)
561
+
### 12.2 Arithmetic (`INT` or `FLT`, no mixing)
562
562
563
-
- `ADD(INT: a, INT: b):INT` ; a + b
563
+
- `ADD(INT|FLT: a, INT|FLT: b):INT|FLT` ; a + b
564
564
565
-
- `SUB(INT: a, INT: b):INT` ; a - b
565
+
- `SUB(INT|FLT: a, INT|FLT: b):INT|FLT` ; a - b
566
566
567
-
- `MUL(INT:a, INT:b):INT` ; a * b
567
+
- `MUL(INT|FLT: a, INT|FLT: b):INT|FLT` ; a * b
568
568
569
-
- `DIV(INT: a, INT: b):INT` ; floor(a / b)
569
+
- `DIV(INT|FLT: a, INT|FLT: b):INT|FLT` ; floor(a / b)
570
570
571
-
- `CDIV(INT: a, INT: b):INT` ; ceil(a / b)
571
+
- `CDIV(INT|FLT: a, INT|FLT: b):INT|FLT` ; ceil(a / b)
572
572
573
-
- `POW(INT: a, INT: b):INT` ; a ^ b
573
+
- `POW(INT|FLT: a, INT|FLT: b):INT|FLT` ; a ^ b
574
574
575
575
- `ROOT(INT|FLT: x, INT|FLT: n):INT|FLT` ; nth root of `x`. No mixing of `INT` and `FLT` is allowed. For `INT` arguments `n` must be non-zero; positive `n` returns the integer nth root (largest integer r with r^n <=xforx>= 0); negative `n` yields an integer result only for `x` equal to `1` or `-1` (reciprocal is integer), and `x <0` requiresodd `n`.For `FLT` argumentstheresultis `x^(1/n)` (negative `n` allowed);negative `x` isallowedonlywhen `n` is an odd integer. Division by zero is an error.
576
576
577
-
- `MOD(INT: a,INT: b):INT` ;remainderofa/b
577
+
- `MOD(INT|FLT: a,INT|FLT: b):INT|FLT` ; remainder of a / b
578
578
579
-
-`NEG(INT: a):INT`;-a(additiveinverse)
579
+
- `NEG(INT|FLT: a):INT|FLT` ; -a (additive inverse)
580
580
581
-
-`ABS(INT: a):INT`;absolutevalueofa
581
+
- `ABS(INT|FLT: a):INT|FLT` ; absolute value of a
582
582
583
-
-`GCD(INT: a, INT: b):INT`;greatestcommondivisorofaandb
583
+
- `GCD(INT|FLT: a,INT|FLT: b):INT|FLT` ; greatest common divisor of a and b
584
584
585
-
-`LCM(INT: a, INT: b):INT`;leastcommonmultipleofaandb
585
+
- `LCM(INT|FLT: a,INT|FLT: b):INT|FLT` ; least common multiple of a and b
586
586
587
587
### 12.3 Bitwise / Boolean
588
588
@@ -779,6 +779,8 @@
779
779
780
780
- `EXISTFILE(STR: path):INT` — Returns `INT` 1 when a filesystem object exists at `path`, otherwise returns `INT` 0. The argument must be a `STR`.
781
781
782
+
- `DELETEFILE(STR: path):INT` — Deletes the filesystem object at `path`. If no filesystem object exists at `path`, the interpreter raises a runtime error (rewrite: `DELETEFILE`). Permission errors and other filesystem failures also raise a runtime error (rewrite: `DELETEFILE`). On success `DELETEFILE` returns `INT` 1.
783
+
782
784
### 12.14 Symbol Freezing:
783
785
784
786
- `FREEZE(SYMBOL: symbol):INT` — Marks the identifier `symbol` as frozen. The first argument must be an identifier (not a string literal). On success `FREEZE` returns `INT` 0. Once a binding is frozen, any attempt to reassign it (via `=` assignment) or to delete it (`DEL`) raises a runtime error (assign attempts signal rewrite: `ASSIGN`; deletion attempts signal rewrite: `DEL`). `FREEZE` locates the binding in the usual lexical environment chain and freezes that specific binding; if the identifier is undefined, the call raises a runtime error (rewrite: `FREEZE`).
0 commit comments