- 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.
推薦閱讀
- Instant Testing with CasperJS
- Raspberry Pi for Python Programmers Cookbook(Second Edition)
- Android Jetpack開發:原理解析與應用實戰
- R語言經典實例(原書第2版)
- Java高并發核心編程(卷2):多線程、鎖、JMM、JUC、高并發設計模式
- Mastering phpMyAdmin 3.4 for Effective MySQL Management
- Python程序設計(第3版)
- Visual C++應用開發
- HTML5從入門到精通(第4版)
- Python Essentials
- Django實戰:Python Web典型模塊與項目開發
- Clojure Polymorphism
- OpenCV Android開發實戰
- 精通Spring:Java Web開發與Spring Boot高級功能
- 深入理解Java虛擬機:JVM高級特性與最佳實踐