nandi/rustnimpublic Fork 0
4e4d09dcdd22d17ba510de5639fc3a952ac73f6e
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.

004-signed-shr.rs · 10 lines · 340 BRust Blame HistoryRaw
Add the differential test runner, and a lowering to measure with it 8ac32af nandithebull 14h ago1// DESIGN.md item 1: Nim's `shr` on a signed integer is arithmetic, like Rust's
2// `>>`. This is the operation base16ct's constant-time decoder depends on.
3fn main() {
4 let x: i16 = -256;
5 println!("{}", x >> 8);
6 println!("{}", (-1i32) >> 16);
7 let y: u16 = 65280;
8 println!("{}", y >> 8);
9 println!("{}", 1i32 << 10);
10}