Skip to content

Absolute value function that returns an unsigned integer

License

Notifications You must be signed in to change notification settings

npmccallum/uabs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workflow Status Average time to resolve an issue Percentage of issues still open Maintenance

uabs

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

About

Absolute value function that returns an unsigned integer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages