Last active
September 25, 2024 10:46
-
-
Save gists-immunefi/09e397eb545c9094c8b68142d966bc1a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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