Skip to main content

Field

Trait Field 

Source
pub trait Field: EuclideanRing + DivisionRing { }
Expand description

A marker trait for types that form a field.

A field is both an EuclideanRing and a DivisionRing, combining commutative ring structure with multiplicative inverses.

§Laws

All EuclideanRing and DivisionRing laws apply.

§Examples

use fp_library::classes::{
	DivisionRing,
	Semiring,
};

// For fields, multiply(a, reciprocate(a)) = one
let a = 3.0f64;
assert_eq!(f64::multiply(a, f64::reciprocate(a)), f64::one());

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 Field for f32

Source§

impl Field for f64

Implementors§