num-lazy
num-lazy helps you write numbers for generic-typed functions, reduce typing, and improve readability!
Why Num-Lazy
Let's write a generic circumference function using num-trait.
This doesn't look too bad. But you can imagine it getting out of hand for more complex functions. This is where num-lazy comes to the rescue! Let's implement using num-lazy.
Quick Start
Install num-lazy by:
>> cargo add num-lazy
Use declare_nums!{T} to bind num-lazy to generic type T.
use declare_nums;
use Float;
declare_nums!
Recommendation
It is recommended to use num-lazy along with numeric-literals by using num-lazy to access macros for constants and special values, while using numeric_literals for parsing floats or numeric literals.
use declare_nums;
use replace_numeric_literals;
use Float;
declare_nums!
declare_nums!