| Crates.io | uabs |
| lib.rs | uabs |
| version | 3.0.0 |
| created_at | 2018-10-10 18:47:37.983032+00 |
| updated_at | 2020-09-07 20:43:19.653042+00 |
| description | Absolute value function that returns an unsigned integer |
| homepage | |
| repository | https://github.com/enarx/uabs |
| max_upload_size | |
| id | 89116 |
| size | 18,143 |
This crate provides the UnsignedAbs trait containing a function uabs()
which calculates the absolute value of the input and returns it as an
unsigned integer of the same size as the input. For example:
use uabs::Uabs;
let x: i8 = -128;
let y: u8 = x.uabs();
assert_eq!(y, 128);
License: Apache-2.0