From 17f68a22e6cfa0dc833290392b7598ccf456b3bf Mon Sep 17 00:00:00 2001 From: Nango Date: Thu, 25 Jun 2020 15:27:23 -0500 Subject: [PATCH] Update ch03-02-data-types.md --- src/ch03-02-data-types.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ch03-02-data-types.md b/src/ch03-02-data-types.md index 2c16433..78dc025 100644 --- a/src/ch03-02-data-types.md +++ b/src/ch03-02-data-types.md @@ -58,11 +58,11 @@ error[E0282]: type annotations needed | 数字字面值 | 例子 | |------------------|---------------| -| Decimal | `98_222` | -| Hex | `0xff` | -| Octal | `0o77` | -| Binary | `0b1111_0000` | -| Byte (`u8` only) | `b'A'` | +| Decimal (十进制) | `98_222` | +| Hex (十六进制) | `0xff` | +| Octal (八进制) | `0o77` | +| Binary (二进制) | `0b1111_0000` | +| Byte (单字节字符)(仅限于`u8`) | `b'A'` | 那么该使用哪种类型的数字呢?如果拿不定主意,Rust 的默认类型通常就很好,数字类型默认是 `i32`:它通常是最快的,甚至在 64 位系统上也是。`isize` 或 `usize` 主要作为某些集合的索引。 @@ -293,4 +293,4 @@ ch02-00-guessing-game-tutorial.html#comparing-the-guess-to-the-secret-number [control-flow]: ch03-05-control-flow.html#control-flow [strings]: ch08-02-strings.html#storing-utf-8-encoded-text-with-strings [unrecoverable-errors-with-panic]: ch09-01-unrecoverable-errors-with-panic.html -[wrapping]: ../std/num/struct.Wrapping.html \ No newline at end of file +[wrapping]: ../std/num/struct.Wrapping.html