From 2e5e64e4e93290d5fb5bfe485bdab706992e8e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aht=D1=96=20L=D0=B5g=CE=BFn=CE=BAov?= Date: Sat, 26 Mar 2022 10:26:38 +0200 Subject: [PATCH] Update cast.md Fix comment for `128 as i8` example. --- src/types/cast.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/types/cast.md b/src/types/cast.md index 79e070d375..95e92decaa 100644 --- a/src/types/cast.md +++ b/src/types/cast.md @@ -52,7 +52,8 @@ fn main() { // Unless it already fits, of course. println!(" 128 as a i16 is: {}", 128 as i16); - // 128 as u8 -> 128, whose two's complement in eight bits is: + + // 128 as u8 -> -128, whose two's complement in eight bits is: println!(" 128 as a i8 is : {}", 128 as i8); // repeating the example above