Files
ansi_term
anyhow
atty
bitflags
bstr
byteorder
cargo_metadata
cargo_preflight
cfg_if
clap
csv
csv_core
darling
darling_core
darling_macro
dlopen
dlopen_derive
fnv
getrandom
glob
heck
ident_case
indoc
itoa
lazy_static
lerp
lerp_derive
libc
libm
maplit
memchr
num_traits
open
pest
pest_derive
pest_generator
pest_meta
ppv_lite86
preflight
preflight_macros
proc_macro2
proc_macro_error
proc_macro_error_attr
quote
rand
rand_chacha
rand_core
regex_automata
ryu
semver
semver_parser
serde
serde_derive
serde_json
smawk
strsim
structopt
structopt_derive
syn
termcolor
textwrap
timescale
timescale_macros
typenum
ucd_trie
unicode_segmentation
unicode_width
unicode_xid
unindent
uom
uuid
vec_map
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/// Macro to implement the [SI][si] prefixes for [multiples of units][mult],
/// [submultiples of units][submult] and [binary multiples of units][bimult].
///
/// Implemented using `macro_rules!` instead of `const` so that type inference at call sites can
/// generate the appropriate float type. Using explicit constants would require duplicate
/// definitions for `f32` and `f64` or casting from `f64` in `f32` contexts.
///
/// [si]: http://jcgm.bipm.org/vim/en/1.16.html
/// [mult]: http://jcgm.bipm.org/vim/en/1.17.html
/// [submult]: http://jcgm.bipm.org/vim/en/1.18.html
/// [bimult]: https://www.iec.ch/si/binary.htm
#[rustfmt::skip]
#[macro_export]
macro_rules! prefix {
    // SI prefixes.
    (yotta) => { 1.0_E24 };
    (zetta) => { 1.0_E21 };
    (exa) => { 1.0_E18 };
    (peta) => { 1.0_E15 };
    (tera) => { 1.0_E12 };
    (giga) => { 1.0_E9 };
    (mega) => { 1.0_E6 };
    (kilo) => { 1.0_E3 };
    (hecto) => { 1.0_E2 };
    (deca) => { 1.0_E1 };
    (none) => { 1.0_E0 };
    (deci) => { 1.0_E-1 };
    (centi) => { 1.0_E-2 };
    (milli) => { 1.0_E-3 };
    (micro) => { 1.0_E-6 };
    (nano) => { 1.0_E-9 };
    (pico) => { 1.0_E-12 };
    (femto) => { 1.0_E-15 };
    (atto) => { 1.0_E-18 };
    (zepto) => { 1.0_E-21 };
    (yocto) => { 1.0_E-24 };

    // Binary prefixes.
    (yobi) => { 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 };
    (zebi) => { 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 };
    (exbi) => { 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 };
    (pebi) => { 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 };
    (tebi) => { 1024.0 * 1024.0 * 1024.0 * 1024.0 };
    (gibi) => { 1024.0 * 1024.0 * 1024.0 };
    (mebi) => { 1024.0 * 1024.0 };
    (kibi) => { 1024.0 };
}