lemonmath::helper

Trait BetterExponent

Source
pub trait BetterExponent {
    // Required method
    fn power(self, number: usize) -> Self;
}
Expand description

Exponents for unsigned integers

§Examples

use lemonmath::helper::BetterExponent;
 
let x = 2u32.pow(3);
 
assert_eq!(x, 8);

Required Methods§

Source

fn power(self, number: usize) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl BetterExponent for u8

Source§

fn power(self, number: usize) -> Self

Source§

impl BetterExponent for u16

Source§

fn power(self, number: usize) -> Self

Source§

impl BetterExponent for u32

Source§

fn power(self, number: usize) -> Self

Source§

impl BetterExponent for u64

Source§

fn power(self, number: usize) -> Self

Source§

impl BetterExponent for u128

Source§

fn power(self, number: usize) -> Self

Implementors§