Skip to content

Commit b134772

Browse files
authored
cast.md improvements for signed boundary case casting
Rewrite comment for boundary case casting to signed value to avoid confusion between "as u8" in comment and "as i8" in print.
1 parent 5bdddcc commit b134772

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/types/cast.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn main() {
5353
// Unless it already fits, of course.
5454
println!(" 128 as a i16 is: {}", 128 as i16);
5555
56-
// 128 as u8 -> 128, whose value in 8-bit two's complement representation is:
56+
// In boundary case 128 value in 8-bit two's complement representation is -128
5757
println!(" 128 as a i8 is : {}", 128 as i8);
5858
5959
// repeating the example above

0 commit comments

Comments
 (0)