https://github.com/njs-guy/in-range-rs
Returns true if a number is in range
https://github.com/njs-guy/in-range-rs
Last synced: 2 months ago
JSON representation
Returns true if a number is in range
- Host: GitHub
- URL: https://github.com/njs-guy/in-range-rs
- Owner: njs-guy
- License: apache-2.0
- Created: 2023-01-25T21:21:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-29T20:44:17.000Z (about 2 years ago)
- Last Synced: 2025-02-02T17:19:32.872Z (3 months ago)
- Language: Rust
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE.txt
Awesome Lists containing this project
README
# In range
A Rust library to return true if a number is in range.
## Usage
First, install the library with
```bash
cargo add in_range
```Then, in code:
```rs
use in_range::in_range;// Args: value, min, max
let result = in_range(10, 1, 15);print!("{}", result);
// Prints true;
```You can also use `not_in_range` to return *false* when value is in range.
```rs
use in_range::not_in_range;// Args: value, min, max
let result = not_in_range(25, 1, 15);print!("{}", result);
// Prints true;
```## License
In range uses the Rust standard MIT/Apache-2.0 dual license for best
compatibility. See
[LICENSE-APACHE.txt](LICENSE-APACHE.txt) and [LICENSE-MIT.txt](LICENSE-MIT.txt)
for the full licenses.