Skip to main content

Abs

Trait Abs 

Source
pub trait Abs {
    type Output;

    // Required method
    fn abs(self) -> Self::Output;
}
Expand description

Absolute value.

§Examples

use dashu_base::Abs;
assert_eq!((-5).abs(), 5);

Required Associated Types§

Required Methods§

Source

fn abs(self) -> Self::Output

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Abs for f32

Source§

type Output = f32

Source§

fn abs(self) -> <f32 as Abs>::Output

Source§

impl Abs for f64

Source§

type Output = f64

Source§

fn abs(self) -> <f64 as Abs>::Output

Source§

impl Abs for i8

Source§

type Output = i8

Source§

fn abs(self) -> <i8 as Abs>::Output

Source§

impl Abs for i16

Source§

type Output = i16

Source§

fn abs(self) -> <i16 as Abs>::Output

Source§

impl Abs for i32

Source§

type Output = i32

Source§

fn abs(self) -> <i32 as Abs>::Output

Source§

impl Abs for i64

Source§

type Output = i64

Source§

fn abs(self) -> <i64 as Abs>::Output

Source§

impl Abs for i128

Source§

type Output = i128

Source§

fn abs(self) -> <i128 as Abs>::Output

Source§

impl Abs for isize

Implementors§