ct_ratio

Crates.ioct_ratio
lib.rsct_ratio
version1.2.0
created_at2025-04-06 18:38:59.435645+00
updated_at2025-04-06 19:04:21.199424+00
descriptionCompile-time rational arithmetic for use in generics
homepage
repositoryhttps://github.com/ChrysoliteAzalea/ct_ratio
max_upload_size
id1623274
size14,284
Азалия Смарагдова (ChrysoliteAzalea)

documentation

README

Compile-time rational arithmetic in Rust

The ct_ratio provides compile-time arithmetic in Rust using const functions and const generics. An example of such code:

type A = Ratio<1, 2>;
type B = Ratio<1, 3>;
type C = <RationalSum<A,B> as StaticArithmetic>::OpResult; // This type will be equal to Ratio<5, 6>

This code relies on a feature generic_const_exprs that is currently (at the README writing time) is considered incomplete. Please, use with caution.

Commit count: 6

cargo fmt