Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,13 @@
// The following will panic!
let i32_1 : i32 = -(-2_147_483_647 - 1);
let i32_2 : i32 = 2_000_000_000 + 2_000_000_000;
let i32_3 : i32 = -2_147_483_647 - 2_147_483_647;
let i32_4 : i32 = 46341 * 46341;
let i32_5 : i32 = (-2_147_483_647 - 1) / -1;
// These will panic! also
let i64_1 : i64 = -(-9_223_372_036_854_775_807 - 1);
let i64_2 : i64 = 5_000_000_000_000_000_000 + 5_000_000_000_000_000_000;
let i64_3 : i64 = -9_223_372_036_854_775_807 - 9_223_372_036_854_775_807;
let i64_4 : i64 = 3_037_000_500 * 3_037_000_500;
let i64_5 : i64 = (-9_223_372_036_854_775_807 - 1) / -1;

View file

@ -0,0 +1,9 @@
// The following will never panic!
println!("{:?}", 65_537u32.checked_mul(65_537)); // None
println!("{:?}", 65_537u32.saturating_mul(65_537)); // 4294967295
println!("{:?}", 65_537u32.wrapping_mul(65_537)); // 131073
// These will never panic! either
println!("{:?}", 65_537i32.checked_mul(65_537)); // None
println!("{:?}", 65_537i32.saturating_mul(65_537)); // 2147483647
println!("{:?}", 65_537i32.wrapping_mul(-65_537)); // -131073