DEV Community

Hirokazu Hirono
Hirokazu Hirono

Posted on

2 1

Basic Signed Integer Type in Rust

Alt Text

println!("{}", std::i8::MIN); // -128
println!("{}", std::i8::MAX); // 127

Alt Text

println!("{}", std::i16::MIN); // -32768
println!("{}", std::i16::MAX); // 32767

Alt Text

println!("{}", std::i32::MIN); // -2147483648
println!("{}", std::i32::MAX); // 2147483647

Alt Text

println!("{}", std::i64::MIN); // -9223372036854775808
println!("{}", std::i64::MAX); // 9223372036854775807

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay