Skip to content

Commit 5a8f854

Browse files
committed
Update neg description
1 parent b3987d0 commit 5a8f854

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

documentation/leo/04_operators.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,9 +783,10 @@ let a: i8 = -1i8.neg(); // 1i8
783783

784784
#### Description
785785

786-
Negates `first`, storing the result in `destination`.
786+
Negates the first operand, storing the result in the destination.
787+
788+
For signed integer types, the operation halts if the minimum value is negated. For example, `-128i8.neg()` halts since `128` cannot be represented as an `i8`.
787789

788-
For signed integer types, calling `neg` on the minimum value is an invalid operation. For example, the input `-128i8` would not be valid since `128` cannot be represented as an `i8`.
789790

790791
#### Supported Types
791792

0 commit comments

Comments
 (0)