num_bound 0.1.0

Add bounds fn to anything implementing `Ord` that bounds a number to a range
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# num_bound


Trait that adds a bound function.

Automatically implemented for anything that is `Ord`

## Usage

`bound(&self, lower: &Self, upper: &Self) -> &Self` 
```rust
let upper = 500;
let lower = 200;

assert_eq!(300.bound(&lower, &upper), 300);
assert_eq!(550.bound(&lower, &upper), 500);
assert_eq!(100.bound(&lower, &upper), 200);
```