- Learning Rust
- Paul Johnson Vesa Kaihlavirta
- 72字
- 2021-07-02 23:07:15
Signed and unsigned integers
A signed int (one that can have positive or negative values) is defined like this:
let sint = 10i32;
An unsigned int has a u instead of i in the definition:
let usint = 10u32;
Again, these are number literals, and the same declaration can be made via types:
let sint: i32 = 10;
Both signed and unsigned int values can be 8, 16, 32, or 64-bits long.
推薦閱讀
- 程序員修煉之道:程序設(shè)計(jì)入門(mén)30講
- Learning ROS for Robotics Programming(Second Edition)
- 大學(xué)計(jì)算機(jī)基礎(chǔ)實(shí)驗(yàn)教程
- 趣學(xué)Python算法100例
- Mastering Unity Shaders and Effects
- Python Data Analysis Cookbook
- 硅谷Python工程師面試指南:數(shù)據(jù)結(jié)構(gòu)、算法與系統(tǒng)設(shè)計(jì)
- 微服務(wù)架構(gòu)深度解析:原理、實(shí)踐與進(jìn)階
- 大話Java:程序設(shè)計(jì)從入門(mén)到精通
- Kubernetes進(jìn)階實(shí)戰(zhàn)
- MySQL數(shù)據(jù)庫(kù)應(yīng)用實(shí)戰(zhàn)教程(慕課版)
- C/C++代碼調(diào)試的藝術(shù)(第2版)
- Learning Ionic(Second Edition)
- C#網(wǎng)絡(luò)編程高級(jí)篇之網(wǎng)頁(yè)游戲輔助程序設(shè)計(jì)
- Visual FoxPro程序設(shè)計(jì)實(shí)驗(yàn)教程