Skip to content

Commit 7466590

Browse files
committed
Fix description of integer conversions
1 parent 069681a commit 7466590

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

conversions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ expression, `e as U2` is not necessarily so (in fact it will only be valid if
210210
For numeric casts, there are quite a few cases to consider:
211211

212212
* casting between two integers of the same size (e.g. i32 -> u32) is a no-op
213-
* casting from a smaller integer to a bigger integer (e.g. u32 -> u8) will truncate
214-
* casting from a larger integer to a smaller integer (e.g. u8 -> u32) will
215-
* zero-extend if the target is unsigned
216-
* sign-extend if the target is signed
213+
* casting from a larger integer to a smaller integer (e.g. u32 -> u8) will truncate
214+
* casting from a smaller integer to a larger integer (e.g. u8 -> u32) will
215+
* zero-extend if the source is unsigned
216+
* sign-extend if the source is signed
217217
* casting from a float to an integer will round the float towards zero
218218
* **NOTE: currently this will cause Undefined Behaviour if the rounded
219219
value cannot be represented by the target integer type**. This is a bug

0 commit comments

Comments
 (0)