qxLib
include
qx
math
units
data.h
Go to the documentation of this file.
1
/**
2
3
@file data.h
4
@author Khrapov
5
@date 11.08.2025
6
@copyright © Nick Khrapov, 2025. All right reserved.
7
8
**/
9
#pragma once
10
11
#include <
qx/math/common.h
>
12
#include <
qx/math/units/base.h
>
13
14
#include <algorithm>
15
16
namespace
qx::units
17
{
18
19
enum class
data
20
{
21
// binary prefixes (not SI)
22
bits = 0,
// 2^0 bits (1 bit)
23
nibbles = 2,
// 2^1 bits (4 bits)
24
bytes = 3,
// 2^3 bits (8 bits)
25
kibibytes = 13,
// 2^13 bits (1024 bytes)
26
mebibytes = 23,
// 2^23 bits (1024 kibibytes)
27
gibibytes = 33,
// 2^33 bits (1024 mebibytes)
28
tebibytes = 43,
// 2^43 bits (1024 gibibytes)
29
pebibytes = 53,
// 2^53 bits (1024 tebibytes)
30
31
_first_si,
32
33
// multiplicative prefixes (SI)
34
kilobytes = _first_si + 3,
// 10^3 bytes
35
megabytes = _first_si + 6,
// 10^6 bytes (1000 kilobytes)
36
gigabytes = _first_si + 9,
// 10^9 bytes (1000 megabytes)
37
terabytes = _first_si + 12,
// 10^12 bytes (1000 gigabytes)
38
petabytes = _first_si + 15,
// 10^15 bytes (1000 terabytes)
39
};
40
41
}
// namespace qx::units
42
43
#include <
qx/math/units/data.inl
>
base.h
data.inl
common.h
Generated by
1.9.1