Skip to content

Instantly share code, notes, and snippets.

@gists-immunefi
Last active September 25, 2024 10:46
Show Gist options
  • Save gists-immunefi/09e397eb545c9094c8b68142d966bc1a to your computer and use it in GitHub Desktop.
Save gists-immunefi/09e397eb545c9094c8b68142d966bc1a to your computer and use it in GitHub Desktop.
impl Power for u32 {
fn pow(self, exponent: u32) -> Self {
asm(r1: self, r2: exponent, r3) {
exp r3 r1 r2;
r3: Self
}
}
}
impl Power for u16 {
fn pow(self, exponent: u32) -> Self {
asm(r1: self, r2: exponent, r3) {
exp r3 r1 r2;
r3: Self
}
}
}
impl Power for u8 {
fn pow(self, exponent: u32) -> Self {
asm(r1: self, r2: exponent, r3) {
exp r3 r1 r2;
r3: Self
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment