nandi/rustnimpublic Fork 0
b0ccd80a849033974bea0c5eccff995ecb632c3e
Commits
Clone
git clone https://git.rickub.com/nandi/rustnim.git
git clone ssh://git@rickub.com/nandi/rustnim.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Add the differential test runner, and a lowering to measure with it 8ac32af · on b0ccd80a849033974bea0c5eccff995ecb632c3e · nandithebull · 11h ago
008-truncating-cast.rs · 11 lines · 375 BRust Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
// Rust's `as` truncates; Nim's `T(x)` range-checks. The lowering uses `cast`,
// which was probed against both compilers.
fn main() {
    println!("{}", 300i32 as u8);
    println!("{}", -1i32 as u32);
    println!("{}", 200u8 as i8);
    println!("{}", 65535u16 as i16);
    println!("{}", -1i64 as u8);
    println!("{}", 65i32 as f64);
    println!("{}", true as i32);
}