Trait rug::complex::Prec

source ·
pub trait Prec {
    // Required method
    fn prec(self) -> (u32, u32);
}
Expand description

The Prec trait is used to specify the precision of the real and imaginary parts of a Complex number.

This trait is implememented for u32 and for (u32, u32).

Examples

use rug::Complex;
let c1 = Complex::new(32);
assert_eq!(c1.prec(), (32, 32));
let c2 = Complex::new((32, 64));
assert_eq!(c2.prec(), (32, 64));

Required Methods§

source

fn prec(self) -> (u32, u32)

Returns the precision for the real and imaginary parts.

Examples
use rug::complex::Prec;
assert_eq!(Prec::prec(24), (24, 24));
assert_eq!(Prec::prec((24, 53)), (24, 53));

Implementations on Foreign Types§

source§

impl Prec for (u32, u32)

source§

fn prec(self) -> (u32, u32)

source§

impl Prec for u32

source§

fn prec(self) -> (u32, u32)

Implementors§