This repository has been archived on 2024-10-16. You can view files and clone it, but cannot push or open issues or pull requests.
pt/members/libpt-bintols/src/lib.rs

29 lines
795 B
Rust
Raw Normal View History

2023-09-20 18:16:21 +02:00
//* # Tools to work with binary values, memory, storage
2023-09-20 20:35:07 +02:00
//!
//! This crate is part of [`pt`](../libpt/index.html), but can also be used as a standalone
//! module.
2023-09-20 18:16:21 +02:00
// official binary prefixes, see [https://en.wikipedia.org/wiki/Binary_prefix]
/// 2^10
pub const KIBI: usize = 2usize.pow(10);
/// 2^20
pub const MEBI: usize = 2usize.pow(20);
/// 2^30
pub const GIBI: usize = 2usize.pow(30);
/// 2^40
pub const TEBI: usize = 2usize.pow(40);
/// 2^50
pub const PEBI: usize = 2usize.pow(50);
/// 2^60
pub const EXBI: u128 = 2u128.pow(60);
// at this point, `usize` would overflow, so we have to switch to a bigger datatype.
/// 2^70
pub const ZEBI: u128 = 2u128.pow(70);
/// 2^80
pub const YOBI: u128 = 2u128.pow(80);
2023-09-29 18:24:19 +02:00
// use libpt_core;
2023-09-20 14:28:40 +02:00
pub mod datalayout;
2023-09-20 15:37:50 +02:00
pub mod display;
pub mod split_numbers;