Integer Constants
Constants สำหรับ integer types
Type Bounds
Section titled “Type Bounds”fn main() { println!("=== Signed Integer Bounds ==="); println!("i8: {} to {}", i8::MIN, i8::MAX); println!("i16: {} to {}", i16::MIN, i16::MAX); println!("i32: {} to {}", i32::MIN, i32::MAX); println!("i64: {} to {}", i64::MIN, i64::MAX); println!("i128: {} to {}", i128::MIN, i128::MAX);
println!("\n=== Unsigned Integer Bounds ==="); println!("u8: {} to {}", u8::MIN, u8::MAX); println!("u16: {} to {}", u16::MIN, u16::MAX); println!("u32: {} to {}", u32::MIN, u32::MAX); println!("u64: {} to {}", u64::MIN, u64::MAX); println!("u128: {} to {}", u128::MIN, u128::MAX);
println!("\n=== Platform Dependent ==="); println!("isize: {} to {}", isize::MIN, isize::MAX); println!("usize: {} to {}", usize::MIN, usize::MAX);
// Hex representation println!("\n=== Hex Representation ==="); println!("u8::MAX = 0x{:X}", u8::MAX); println!("u16::MAX = 0x{:X}", u16::MAX); println!("u32::MAX = 0x{:X}", u32::MAX); println!("u64::MAX = 0x{:X}", u64::MAX);}เข้าสู่ระบบเพื่อดูเนื้อหาเต็ม
ยืนยันตัวตนด้วยบัญชี Google เพื่อปลดล็อกบทความทั้งหมด
Login with Google