unit-interval 0.1.0

Types for working with and constraining values to the unit interval.
Documentation
  • Coverage
  • 100%
    27 out of 27 items documented15 out of 24 items with examples
  • Size
  • Source code size: 26.78 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.58 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Mainzu/unit-interval
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Mainzu

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.