Skip to content

Commit

Permalink
Merge pull request #111 from l1ch40/fix-content
Browse files Browse the repository at this point in the history
fix: 修正「数值类型」总结内容
  • Loading branch information
sunface committed Jan 3, 2022
2 parents 4a86caa + 91f9f6e commit 4abb83c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion course-book/contents/basic/base-type/numbers.md
Expand Up @@ -285,7 +285,7 @@ use num::complex::Complex;

- **Rust拥有相当多的数值类型**. 因此你需要熟悉这些类型所占用的字节数,这样就知道该类型允许的大小范围以及你选择的类型是否能表达负数
- **类型转换必须是显式的**. Rust永远也不会偷偷把你的16bit整数转换成32bit整数
- **Rust的数值上可以使用方法**. 例如你可以用以下方法来将`24.5`取整: `13.14_f32.round()`, 在这里我们使用了类型后缀,因为编译器需要知道`13.14`的具体类型
- **Rust的数值上可以使用方法**. 例如你可以用以下方法来将`13.14`取整: `13.14_f32.round()`, 在这里我们使用了类型后缀,因为编译器需要知道`13.14`的具体类型

数值类型的讲解已经基本结束,接下来来看看字符和布尔类型。

Expand Down

0 comments on commit 4abb83c

Please sign in to comment.