Init
This commit is contained in:
51
cppdraft/bit/endian.md
Normal file
51
cppdraft/bit/endian.md
Normal file
@@ -0,0 +1,51 @@
|
||||
[bit.endian]
|
||||
|
||||
# 22 General utilities library [[utilities]](./#utilities)
|
||||
|
||||
## 22.11 Bit manipulation [[bit]](bit#endian)
|
||||
|
||||
### 22.11.8 Endian [bit.endian]
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L16022)
|
||||
|
||||
Two common methods of byte ordering in multibyte scalar types are big-endian
|
||||
and little-endian in the execution environment[.](#1.sentence-1)
|
||||
|
||||
Big-endian is a format for
|
||||
storage of binary data in which the most significant byte is placed first,
|
||||
with the rest in descending order[.](#1.sentence-2)
|
||||
|
||||
Little-endian is a format for storage of
|
||||
binary data in which the least significant byte is placed first, with the rest
|
||||
in ascending order[.](#1.sentence-3)
|
||||
|
||||
This subclause describes the endianness of the scalar types
|
||||
of the execution environment[.](#1.sentence-4)
|
||||
|
||||
[ð](#lib:endian)
|
||||
|
||||
`enum class endian {
|
||||
little = see below,
|
||||
big = see below,
|
||||
native = see below
|
||||
};
|
||||
`
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L16044)
|
||||
|
||||
If all scalar types have size 1 byte, then all of endian::little,endian::big, and endian::native have the same value[.](#2.sentence-1)
|
||||
|
||||
Otherwise, endian::little is not equal to endian::big[.](#2.sentence-2)
|
||||
|
||||
If all scalar types are big-endian, endian::native is
|
||||
equal to endian::big[.](#2.sentence-3)
|
||||
|
||||
If all scalar types are little-endian, endian::native is
|
||||
equal to endian::little[.](#2.sentence-4)
|
||||
|
||||
Otherwise, endian::native is not equal
|
||||
to either endian::big or endian::little[.](#2.sentence-5)
|
||||
Reference in New Issue
Block a user