unit-interval

Crates.iounit-interval
lib.rsunit-interval
version0.1.0
sourcesrc
created_at2024-08-23 16:37:24.138414
updated_at2024-08-23 16:37:24.138414
descriptionTypes for working with and constraining values to the unit interval.
homepage
repositoryhttps://github.com/Mainzu/unit-interval
max_upload_size
id1349391
size26,673
(Mainzu)

documentation

README

Unit Interval

Crates.io Documentation

A small crate that provide type-level constrain for numerical values.

Features

  • Type level representation of values in [0, 1]
  • Checked and clamped arithmetic operations
  • Conversion to and from the underlying numeric type
  • Error types for values outside the interval
  • Support for various numeric types through generics

Documentation

For examples and information about the API, please check the documentation.

Motivation

This crate came about as an over-engineered way to work with fractions at a type-level for a ratio type.

Commit count: 0

cargo fmt