un-prim

Crates.ioun-prim
lib.rsun-prim
version0.1.2
sourcesrc
created_at2022-09-01 10:12:10.515989
updated_at2022-09-06 07:55:21.729645
descriptionCustom primitive types
homepage
repositoryhttps://github.com/rebrave04/un-prim
max_upload_size
id656573
size78,134
(K1ponk)

documentation

https://docs.rs/un-prim/latest

README

UN-PRIM

build License: GPL v3 crates.io

Unusual primitive types for any rust project.

This crate was unstable and maybe lot's of bugs and I suggest not to use this.

Usage

[dependencies]
un-prim = "0.1"
use un_prim::*;

let x: U256 = 100u128.into();
let y: U256 = 2u128.into();
let z = x * y;

assert_eq!(200u64, z.into());

Macro

To create new type, you can use macro define!.

use un_prim::*;

define!(U512, 64, "512-bits custom type.");

let x: U512 = 100u8.into();

assert_eq!(x * 2u8.into(), 200u8.into());

TODO

  • Add Pow/Exp method for each types.
  • Add SQRT method for each types.
Commit count: 0

cargo fmt