Expand description
Fraction numbers
§Compatibility
The fractions-rs crate is tested for rustc 1.70 and greater.
It supports no_std environments with optional features:
[dependencies]
fractions = { version = "0.1", default-features = false }§no_std Usage
ⓘ
#![no_std]
use fractions::Fraction;
fn main() {
let a = Fraction::new(1i32, 2);
let b = Fraction::new(1i32, 4);
let c = a + b;
assert_eq!(c, Fraction::new(3, 4));
}Re-exports§
Modules§
Functions§
- archimedes
- The function
archimedescalculates the area of a triangle using Archimedes’ formula with the lengths of the three sides provided asFraction<i64>values.