News for hackers. Stuff that matters.
Re:Let rand = main as usize by vlovich123 on Thursday June 06, 2024 @04:32PM (#40602048)
Sorry, was thinking of signed integer overflow which while considered sound is simultaneously considered to be a a bug in your code (hence the panic in debug mode and requires the use of wrapping_add if you intend the wrapping).
Re:Let rand = main as usize by comex on Friday June 07, 2024 @12:05AM (#40605227)
Rust behaves as you describe for both signed and unsigned.