Skip to content

Commit

Permalink
Update integer.md
Browse files Browse the repository at this point in the history
  • Loading branch information
iago-lito authored Aug 5, 2022
1 parent aa3d0b6 commit 6661563
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/english/hpc/arithmetic/integer.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ This seems like an important architecture aspect, but in most cases, it doesn't
- Little-endian has the advantage that you can cast a value to a smaller type (e.g., `long long` to `int`) by just loading fewer bytes, which in most cases means doing nothing — thanks to *register aliasing*, `eax` refers to the first 4 bytes of `rax`, so conversion is essentially free. It is also easier to read values in a variety of type sizes — while on big-endian architectures, loading an `int` from a `long long` array would require shifting the pointer by 2 bytes.
- Big-endian has the advantage that higher bytes are loaded first, which in theory can make highest-to-lowest routines such as comparisons and printing faster. You can also perform certain checks such as finding out whether a number is negative by only loading its first byte.

Big-endian is also more "natural" — this is how we write binary numbers on paper — but the advantage of having faster type conversions outweigh it. For this reason, little-endian is used by default on most hardware, although some CPUs are "bi-endian" and can be configured to switch modes on demand.
Big-endian is also more "natural" — this is how we write binary numbers on paper — but the advantage of having faster type conversions outweights it. For this reason, little-endian is used by default on most hardware, although some CPUs are "bi-endian" and can be configured to switch modes on demand.

### 128-bit Integers

Expand Down

0 comments on commit 6661563

Please sign in to comment.