Skip to content

Instantly share code, notes, and snippets.

View eNipu's full-sized avatar
🎯
Focusing

Md. Al-Amin Khandaker eNipu

🎯
Focusing
View GitHub Profile
@eNipu
eNipu / keybase.md
Created February 6, 2022 09:53
keybase

Keybase proof

I hereby claim:

  • I am eNipu on github.
  • I am alamintech (https://keybase.io/alamintech) on keybase.
  • I have a public key whose fingerprint is A4FE 3AC2 36F3 9709 1887 F91F CFF6 E410 4AAC 4EBB

To claim this, I am signing this object:

@eNipu
eNipu / average.rs
Created February 4, 2022 11:20
overage without overflow
fn average_without_overflow(a: i32, b: i32) -> i32 {
return (a & b) + ((a ^ b) >> 1);
}
fn average_with_overflow(a: i32, b: i32) -> i32 {
let avg = (a+b)/2;
return avg;
}
fn main() {