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
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -685,7 +685,7 @@
685
685
686
686
The subsections below use a type-annotation convention. A type annotation is written as `TYPE name`, where `TYPE` is followed by one or more space characters and then the annotated name. A union notation such as `INT|FLT` restricts an argument to any one of the listed types. `ANY` denotes any runtime type (`BOOL`, `INT`, `FLT`, `STR`, `TNS`, `MAP`, `FUNC`, or `THR`), including extension-defined types when extensions are active, unless the signature narrows the set explicitly. `SYMBOL` is a pseudo-type indicating that the argument MUST be a plain unquoted identifier; such operators receive the symbol name rather than its runtime value.
687
687
688
-
`MODULE` is a pseudo-type indicating that the argument MUST be a plain unquoted module identifier or a package-qualified module name using the language's `..` separator. A slash-separated signature such as `ADD/SUB/MUL` denotes a family of distinct operators that share the same argument rules and differ only in the named operation.
688
+
`MODULE` is a pseudo-type indicating that the argument MUST be a plain unquoted module identifier or a package-qualified module name using the language's `..` separator. A comma-separated signature such as `+, -, *` denotes a family of distinct operators that share the same argument rules and differ only in the named operation.
689
689
690
690
`EXTENSION` is a pseudo-type indicating that the argument MUST be a plain unquoted extension specifier used by `EXTEND`, excluding the platform filename suffix and optionally using package-style `..` separators.
691
691
@@ -737,15 +737,15 @@
737
737
738
738
#### 9.1.3 Arithmetic operators
739
739
740
-
- `INT|FLT ADD/SUB/MUL/DIV/CDIV/POW/MOD(INT|FLT a, INT|FLT b)` = MUST implement, respectively, addition, subtraction, multiplication, division, ceiling division, exponentiation, and remainder. Except where an operator explicitly states otherwise, `a` and `b` MUST have the same numeric type. Division by zero MUST raise a runtime error.
740
+
- `INT|FLT +, -, *, /, CDIV, POW, MOD(INT|FLT a, INT|FLT b)` = MUST implement, respectively, addition, subtraction, multiplication, division, ceiling division, exponentiation, and remainder. Except where an operator explicitly states otherwise, `a` and `b` MUST have the same numeric type. Division by zero MUST raise a runtime error.
741
741
742
742
- `INT|FLT NEG/ABS(INT|FLT value)` = MUST return the additive inverse or absolute value of `value`, respectively.
743
743
744
744
- `INT|FLT GCD/LCM(INT|FLT a, INT|FLT b)` = MUST compute the greatest common divisor or least common multiple of `a` and `b`. Mixed `INT` and `FLT` operands MUST be rejected.
745
745
746
746
- `INT|FLT ROOT(INT|FLT x, INT|FLT n)` = MUST compute the `n`th root of `x`. For `INT` operands, positive `n` MUST produce the greatest integer `r` such that `r^n <=x` whenthatnotionisdefined; `n=0` MUST raise a runtime error; and negative-`n` integer results are valid only where the reciprocal remains an integer. For `FLT` operands, the result MUST be `x^(1/n)`, with negative `x` permitted only when `n` denotes an odd integer. Invalid roots MUST raise a runtime error.
747
747
748
-
- `INTIADD/ISUB/IMUL/IDIV/IPOW/IROOT(INT|FLTa,INT|FLTb)` and `FLTFADD/FSUB/FMUL/FDIV/FPOW/FROOT(INT|FLTa,INT|FLTb)` = MUST first coerce both operands to the target numeric type and then perform the corresponding arithmetic operation. Failed coercion MUST raise a runtime error.
748
+
- `INTI+, I-, I*, I/,IPOW,IROOT(INT|FLTa,INT|FLTb)`and`FLTF+,F-,F*,F/,FPOW,FROOT(INT|FLTa,INT|FLTb)` = MUST first coerce both operands to the target numeric type and then perform the corresponding arithmetic operation. Failed coercion MUST raise a runtime error.
749
749
750
750
- `INT|FLTSUM/PROD(INT|FLTa1, ...,INT|FLTaN)`, `INTISUM/IPROD(INT|FLTa1, ...,INT|FLTaN)`, and `FLTFSUM/FPROD(INT|FLTa1, ...,INT|FLTaN)` = MUST compute the corresponding aggregate sum or product across all arguments. The unprefixed forms MUST reject mixed `INT` and `FLT` operands.
751
751
@@ -815,11 +815,11 @@
815
815
816
816
- `BOOLIN(ANYvalue,TNStensor)` = MUST return `TRUE` if any tensor element is equal to `value` and `FALSE` otherwise.
817
817
818
-
- `TNSMADD/MSUB/MMUL/MDIV(TNSx,TNSy)` = MUST perform elementwise tensor-tensor arithmetic. The input shapes MUST match exactly, the element types MUST be uniformly numeric and mutually compatible, and division by zero MUST raise a runtime error.
818
+
- `TNSM+,M-,M*,M/(TNSx,TNSy)` = MUST perform elementwise tensor-tensor arithmetic. The input shapes MUST match exactly, the element types MUST be uniformly numeric and mutually compatible, and division by zero MUST raise a runtime error.
819
819
820
820
- `TNSMSUM/MPROD(TNSt1, ...,TNStN)` = MUST perform elementwise sum or product across tensors of identical shape and mutually compatible numeric element type.
821
821
822
-
- `TNSTADD/TSUB/TMUL/TDIV/TPOW(TNStensor,INT|FLTscalar)` = MUST perform tensor-scalar arithmetic. All tensor elements and the scalar MUST share the same numeric type, except where a specific operator explicitly permits widening. Division by zero MUST raise a runtime error.
822
+
- `TNST+,T-,T*,T/,TPOW(TNStensor,INT|FLTscalar)` = MUST perform tensor-scalar arithmetic. All tensor elements and the scalar MUST share the same numeric type, except where a specific operator explicitly permits widening. Division by zero MUST raise a runtime error.
0 commit comments