num-lazy 0.1.0

Number macros for generic-typed functions.
Documentation

num-lazy

num-lazy helps you write numbers for generic-typed functions, reduce typing, and improve readability!

Quick Start

Install num-lazy by:

>> cargo add num-lazy

Use declare_nums!{T} to bind num-lazy to generic type T.

use num_lazy::declare_nums;
use num_traits::Float;
declare_nums!{T}

fn circumference<T: Float>(radius: T) -> T {
    two!() * pi!() * radius
}

fn main() {
    assert!(circumference(1.0_f64) == 6.283185307179586);
}