<commit_before># Checked
Implements a wrapper over the primitive Rust types that better indicates overflow during arithmetic.

The struct Checked is actually a wrapper over an Option, so if x is a Checked object, then x.0 can be used like an Option.

## Example

```
extern crate checked
use checked::Checked;

fn main() {
    let x = Checked::from(1_000_000_000_u32) * 3 + 2_000_000_000;
    match x.0 {
        Some(y) => println!("Didn't overflow: x is {}.", y),
        None => println!("The arithmetic overflowed."),
    }
}
```

Note that Add\<T\> is implemented for Checked\<T\> for all the primitive integer types T (u8, i16, etc.) so really, only the left-most integer needs to be a Checked object.
Once the arithmetic hits a Checked\<T\> on the right OR left, all the remaining results are Checked too.
Just make sure there's a Checked somewhere before the first potential overflow.

This struct is based on std::num::Wrapping, except using checked arithmetic instead of wrapped arithmetic.

## Contributing
I may try to add more features in time: make an Issue or Pull request to get the ball rolling.

## Upcoming features
* More detailed docs are coming.
* Add/Multiply/etc. Checked ints to normal ints on both sides.
<commit_msg>upcoming features are now implemented<commit_after># Checked
Implements a wrapper over the primitive Rust types that better indicates overflow during arithmetic.

The struct Checked is actually a wrapper over an Option, so if x is a Checked object, then x.0 can be used like an Option.

## Example

```
extern crate checked
use checked::Checked;

fn main() {
    let x = Checked::from(1_000_000_000_u32) * 3 + 2_000_000_000;
    match x.0 {
        Some(y) => println!("Didn't overflow: x is {}.", y),
        None => println!("The arithmetic overflowed."),
    }
}
```

Note that Add\<T\> is implemented for Checked\<T\> for all the primitive integer types T (u8, i16, etc.) so really, only the left-most integer needs to be a Checked object.
Once the arithmetic hits a Checked\<T\> on the right OR left, all the remaining results are Checked too.
Just make sure there's a Checked somewhere before the first potential overflow.

This struct is based on std::num::Wrapping, except using checked arithmetic instead of wrapped arithmetic.

## Contributing
I may try to add more features in time: make an Issue or Pull request to get the ball rolling.

{'fraction_non_alphanumeric': 0.08235785953177258, 'fraction_numerical': 0.023411371237458192, 'mean_word_length': 3.9238683127572016, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6550170', 'n_tokens_mistral': 737, 'n_tokens_neox': 661, 'n_words': 340}