IEEE floating-point notes.

c-declarations
Joshua Potter 2024-03-16 23:02:50 -04:00
parent db1d3dd14e
commit 444418d78e
14 changed files with 1110 additions and 26 deletions

View File

@ -96,7 +96,11 @@
"floor-positive.png",
"ceil-positive.png",
"ceil-negative.png",
"pascals-triangle.png"
"pascals-triangle.png",
"normalized-form.png",
"denormalized-form.png",
"infinity.png",
"nan.png"
],
"File Hashes": {
"algorithms/index.md": "cd7c7ba91fb2f961c9f2437777e8e2ac",
@ -196,7 +200,7 @@
"combinatorics/additive-principle.md": "e968028670f95ee9a7c5499ff7cb6792",
"_journal/2024-02-19.md": "30d16c5373deb9cb128d2e7934ae256a",
"_journal/2024-02/2024-02-18.md": "67e36dbbb2cac699d4533b5a2eaeb629",
"combinatorics/permutations.md": "989c076a9f6909627f4decafd4118266",
"combinatorics/permutations.md": "05744081be9ae2962cf5ba817b5357d2",
"combinatorics/combinations.md": "5ae0152180a1af7187c43606a4002202",
"_journal/2024-02-20.md": "b85ba0eeeb16e30a602ccefabcc9763e",
"_journal/2024-02/2024-02-19.md": "df1a9ab7ab89244021b3003c84640c78",
@ -208,7 +212,7 @@
"_journal/2024-02/2024-02-21.md": "f423137ae550eb958378750d1f5e98c7",
"_journal/2024-02-23.md": "219ce9ad15a8733edd476c97628b71fd",
"_journal/2024-02/2024-02-22.md": "312e55d57868026f6e80f7989a889c2b",
"c17/strings.md": "62b53cc9156eba2b565e33d07813cf50",
"c17/strings.md": "d8a1193ecbbc43aa81539585babb91b1",
"c17/index.md": "78576ee41d0185df82c59999142f4edb",
"c17/escape-sequences.md": "ebc63c6cdfbe60bbc2708c1b0c8da8bb",
"c17/declarations.md": "20e200f2b7abcab8f873cd080f4c9770",
@ -227,7 +231,7 @@
"filesystems/cas.md": "34906013a2a60fe5ee0e31809b4838aa",
"git/objects.md": "e9b98576291ca04496c2f0863f526cfa",
"git/index.md": "83d2d95fc549d9e8436946c7bd058d15",
"encoding/integer.md": "ef26036d0c0d215e8b626b5db872b028",
"encoding/integer.md": "87f6b405cc33a5f8517588928b0cb17e",
"_journal/2024-02-29.md": "f610f3caed659c1de3eed5f226cab508",
"_journal/2024-02/2024-02-28.md": "7489377c014a2ff3c535d581961b5b82",
"_journal/2024-03-01.md": "a532486279190b0c12954966cbf8c3fe",
@ -244,8 +248,8 @@
"_journal/2024-03/2024-03-03.md": "64e2f17b4d57a6bd42a3d1b7f2851b83",
"_journal/2024-03-05.md": "e9a911c19bb4c0ff451db793248cb4bb",
"_journal/2024-03/2024-03-04.md": "4948d90a08af2cff58c629c9a2e11ee4",
"algebra/sequences/geometric.md": "53936ec392b3b714bd4a9bdb4554b582",
"algebra/sequences/arithmetic.md": "674256494cdec6f12be553b27918e2d9",
"algebra/sequences/geometric.md": "3cf58281df1d72bdd853eab4d24d75f2",
"algebra/sequences/arithmetic.md": "5ac02c9a08962dd816e4c4a53761e602",
"_journal/2024-03-06.md": "ac7a3d764934f49b2be7aa76e402d853",
"_journal/2024-03/2024-03-05.md": "94b28d0b9bc62cc0bd99d315fb7c6d30",
"_journal/2024-03-07.md": "7bf68d6d81e89aa00f5ddd7510b69e3e",
@ -265,7 +269,11 @@
"_journal/2024-03-14.md": "1c173cab2e903aad876c5f11d49a8b20",
"_journal/2024-03/2024-03-13.md": "6a2ad92d0983c36acef93932bfec1758",
"git/references.md": "73792b2c7a0700a58336e045915ba0d4",
"_journal/2024-03-15.md": "879afe6bc882e494be20a284196747a5"
"_journal/2024-03-15.md": "a1f0ba85b8d3dd8cf1976373298eb717",
"encoding/float.md": "4a1b49e2f3223c913dfdf469429002bd",
"_journal/2024-03/2024-03-14.md": "1c173cab2e903aad876c5f11d49a8b20",
"_journal/2024-03-16.md": "ef1bcb4d28790c8a32691ddedd6c289f",
"_journal/2024-03/2024-03-15.md": "e54b2513beac5f46313b4c37622adf39"
},
"fields_dict": {
"Basic": [

View File

@ -1,11 +0,0 @@
---
title: "2024-03-15"
---
- [x] Anki Flashcards
- [x] KoL
- [ ] Sheet Music (10 min.)
- [ ] Go (1 Life & Death Problem)
- [ ] Korean (Read 1 Story)
- [ ] Interview Prep (1 Practice Problem)
- [x] Log Work Hours (Max 3 hours)

View File

@ -0,0 +1,15 @@
---
title: "2024-03-16"
---
- [x] Anki Flashcards
- [x] KoL
- [ ] Sheet Music (10 min.)
- [ ] Go (1 Life & Death Problem)
- [ ] Korean (Read 1 Story)
- [ ] Interview Prep (1 Practice Problem)
- [ ] Log Work Hours (Max 3 hours)
* Finished chapter 4 of "Designing Data-Intensive Applications". The second half focused on dataflow.
* Continue adding more flashcards on IEEE floating-point.
* Ascended in KoL. Started new run as a Turtle Tamer.

View File

@ -0,0 +1,14 @@
---
title: "2024-03-15"
---
- [x] Anki Flashcards
- [x] KoL
- [ ] Sheet Music (10 min.)
- [ ] Go (1 Life & Death Problem)
- [ ] Korean (Read 1 Story)
- [ ] Interview Prep (1 Practice Problem)
- [x] Log Work Hours (Max 3 hours)
* Added first batch of flashcards on IEEE Standard 754.
* Read first half of chapter 4 in "Designing Data-Intensive Applications". Touches on different data encodings.

View File

@ -93,7 +93,7 @@ END%%
%%ANKI
Basic
Let $(a_n)_{n \geq 1}$ be an arithmetic sequence. What does term $n$ correspond to in the following? $$\sum_{k=1}^n a_k = \frac{(a_1 + a_n)(n)}{2}$$
Let $(a_n)_{n \geq 1}$ be an arithmetic sequence. What does term $n$ correspond to in the following? $$\sum a_k = \frac{(a_1 + a_n)(n)}{2}$$
Back: The number of terms in the summation.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1709664600175-->
@ -123,7 +123,7 @@ END%%
%%ANKI
Basic
Let $(a_n)_{n \geq 1}$ be an arithmetic sequence. What does term $2$ correspond to in the following? $$\sum_{k=1}^n a_k = \frac{(a_1 + a_n)(n)}{2}$$
Let $(a_n)_{n \geq 1}$ be an arithmetic sequence. What does term $2$ correspond to in the following? $$\sum a_k = \frac{(a_1 + a_n)(n)}{2}$$
Back: The double-counting that occurs when adding the summation to itself.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1709664600179-->
@ -131,7 +131,7 @@ END%%
%%ANKI
Basic
Let $(a_n)_{n \geq 1}$ be an arithmetic sequence. How do we visualize the role of term $2$ in the following? $$\sum_{k=1}^n a_k = \frac{(a_1 + a_n)(n)}{2}$$
Let $(a_n)_{n \geq 1}$ be an arithmetic sequence. How do we visualize the role of term $2$ in the following? $$\sum a_k = \frac{(a_1 + a_n)(n)}{2}$$
Back:
```
* * * * -

View File

@ -100,7 +100,7 @@ END%%
%%ANKI
Basic
Let $(a_n)_{n \geq 1}^r$ be a geometric sequence. What does term $n$ correspond to in the following? $$\sum_{k=1}^n a_k = \frac{a_1(1 - r^n)}{1 - r}$$
Let $(a_n)_{n \geq 1}^r$ be a geometric sequence. What does term $n$ correspond to in the following? $$\sum a_k = \frac{a_1(1 - r^n)}{1 - r}$$
Back: The number of terms in the summation.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1709666305438-->
@ -122,8 +122,8 @@ END%%
%%ANKI
Basic
Let $(a_n)_{n \geq 1}^r$ be a geometric sequence. How is term $1 - r$ derived in the following? $$\sum_{k=1}^n a_k = \frac{a_1(1 - r^n)}{1 - r}$$
Back: Given $S = \sum_{k=1}^n a_k$, by factoring out $S$ from $S - rS$.
Let $(a_n)_{n \geq 1}^r$ be a geometric sequence. How is term $1 - r$ derived in the following? $$\sum a_k = \frac{a_1(1 - r^n)}{1 - r}$$
Back: Given $S = \sum a_k$, by factoring out $S$ from $S - rS$.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1709666356524-->
END%%

View File

@ -337,6 +337,7 @@ Specifier | Description
`o` | an octal `unsigned int`
`f`, `F` | a `double` in fixed-point notation
`e`, `E` | a `double` in standard notation
`g`, `G` | a `double` in normal or standard notation
`s` | a `NUL`-terminated string
`c` | a `char` character
`p` | `void*` address in an implementation-defined format
@ -549,6 +550,15 @@ Tags: printf
<!--ID: 1710450452447-->
END%%
%%ANKI
Basic
Which format specifiers correspond to scientific notation?
Back: `%e` and `%E`
Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962).
Tags: printf
<!--ID: 1710556915108-->
END%%
%%ANKI
Basic
Which format specifier was probably used to yield `printf` output `1.723450e+02`?
@ -603,6 +613,94 @@ Tags: printf
<!--ID: 1710452502034-->
END%%
%%ANKI
Cloze
The {`%g`} format specifier outputs a {lowercase `double` in fixed-point or standard notation}.
Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962).
Tags: printf
<!--ID: 1710599835115-->
END%%
%%ANKI
Basic
The {`%G`} format specifier outputs a {uppercase `double` in fixed-point or standard notation}.
Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962).
Tags: printf
<!--ID: 1710599806324-->
END%%
%%ANKI
Basic
The `%g` format specifier subsumes functionality of what other format specifiers?
Back: `%f` and `%e`
Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962).
Tags: printf
<!--ID: 1710599806326-->
END%%
%%ANKI
Basic
The `%G` format specifier subsumes functionality of what other format specifiers?
Back: `%F` and `%E`
Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962).
Tags: printf
<!--ID: 1710599806328-->
END%%
%%ANKI
Basic
How does `%g` handle integral values differently from `%f`?
Back: It excludes a trailing `.` and insignificant `0`s.
Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962).
Tags: printf
<!--ID: 1710603411171-->
END%%
%%ANKI
Basic
How does `%g` handle non-integral values differently from `%f`?
Back: It excludes insignifant `0`s after the `.`.
Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962).
Tags: printf
<!--ID: 1710603411174-->
END%%
%%ANKI
Basic
What distinguishes `%g` from `%G`?
Back: The former uses lowercase letters. The latter uses uppercase letters.
Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962).
Tags: printf
<!--ID: 1710599806331-->
END%%
%%ANKI
Basic
What is the output of `printf("%g", 3.14)`?
Back: `3.14`
Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962).
Tags: printf
<!--ID: 1710599806333-->
END%%
%%ANKI
Basic
What is the output of `printf("%g", 3)`?
Back: `3`
Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962).
Tags: printf
<!--ID: 1710599806334-->
END%%
%%ANKI
Basic
What is the output of `printf("%f", 3)`?
Back: `3.000000`
Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962).
Tags: printf
<!--ID: 1710599806336-->
END%%
%%ANKI
Cloze
The {`%o`} format specifier outputs an {octal `unsigned int`}.

View File

@ -112,7 +112,7 @@ END%%
%%ANKI
Basic
$n!$ is shorthand for what other closed formula?
$n!$ is shorthand for what other "big operator" formula?
Back: $\Pi_{k=1}^n k$
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708366788594-->

959
notes/encoding/float.md Normal file
View File

@ -0,0 +1,959 @@
---
title: Float Encoding
TARGET DECK: Obsidian::STEM
FILE TAGS: binary::float ieee
tags:
- binary
- ieee
- float
---
## Overview
The IEEE floating-point standard defines an encoding used to represent numbers of form $$(-1)^s \times M \times 2^E$$ where $s$ denotes the **sign bit**, $M$ the **significand**, and $E$ the **exponent**. The binary representation of floating point numbers are segmented into three fields: the sign bit, the exponent field, and the fraction field. Furthermore, there are two forms these fields are interpreted with respect to:
* Normalized Form
* Here the exponent field is neither all `0`s nor all `1`s.
* The significand is $1 + f$, where $f$ denotes the fractional part.
* $E = e - Bias$ where $e$ is the unsigned interpretation of the exponent field.
* Denormalized Form
* Here the exponent field is either all `0`s or all `1`s.
* The significand is $f$, where $f$ denotes the fractional part.
* $E = 1 - Bias$, defined for smooth transition between normalized and denormalized values.
The $Bias$ in both forms is set to $2^{k - 1} - 1$ where $k$ denotes the number of bits that make up the exponent field. In C, fields have the following widths:
Declaration | Sign Bit | Exponent Field | Fractional Field
----------- | -------- | -------------- | ----------------
`float` | `1` | `8` | `23`
`double` | `1` | `11` | `52`
%%ANKI
Basic
In base-10 scientific notation, what form do non-zero numbers take on?
Back: $m \times 10^n$
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914921-->
END%%
%%ANKI
Basic
What radix is implicitly specified in scientific notation form $m \times 10^n$?
Back: $10$
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914924-->
END%%
%%ANKI
Basic
In base-10 scientific notation, what numbers does $m$ take on in form $m \times 10^n$?
Back: A non-zero real number.
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914926-->
END%%
%%ANKI
Basic
In base-10 scientific notation, what numbers does $n$ take on in $m \times 10^n$?
Back: An integer.
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914929-->
END%%
%%ANKI
Basic
What term refers to $m$ in scientific notation $m \times 10^n$?
Back: The significand.
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914932-->
END%%
%%ANKI
Basic
What term refers to $n$ in scientific notation $m \times 10^n$?
Back: The exponent.
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914935-->
END%%
%%ANKI
Basic
What does it mean for $m \times 10^n$ to be in normalized form?
Back: That $1 \leq |m| < 10$.
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914937-->
END%%
%%ANKI
Basic
In base-2 scientific notation, what form do non-zero numbers take on?
Back: $m \times 2^n$
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914939-->
END%%
%%ANKI
Basic
What radix is implicitly specified in scientific notation form $m \times 2^n$?
Back: $2$
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914941-->
END%%
%%ANKI
Basic
In base-2 scientific notation, what numbers does $m$ take on in form $m \times 2^n$?
Back: A non-zero real number.
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914943-->
END%%
%%ANKI
Basic
In base-2 scientific notation, what numbers does $n$ take on in $m \times 2^n$?
Back: An integer.
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914945-->
END%%
%%ANKI
Basic
What term refers to $m$ in scientific notation $m \times 2^n$?
Back: The significand.
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914947-->
END%%
%%ANKI
Basic
What term refers to $n$ in scientific notation $m \times 2^n$?
Back: The exponent.
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914949-->
END%%
%%ANKI
Basic
What does it mean for scientific notation $m \times 2^n$ to be in normalized form?
Back: That $m$ has value $1$.
Reference: “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).
<!--ID: 1710556914951-->
END%%
%%ANKI
Basic
How is IEEE pronounced?
Back: "eye-triple-ee"
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914953-->
END%%
%%ANKI
Basic
What is IEEE an acronym for?
Back: **I**nstitute of **E**lectrical and **E**lectronics **E**ngineers.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914955-->
END%%
%%ANKI
Basic
What IEEE standard describes floating point operations?
Back: 754
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914957-->
END%%
%%ANKI
Basic
What alternative name does IEEE Standard 754 go by?
Back: IEEE floating point
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914959-->
END%%
%%ANKI
Basic
What floating point encoding is guaranteed by the C standard?
Back: N/A
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556914961-->
END%%
%%ANKI
Basic
What floating point encoding is used in most C implementations?
Back: IEEE Standard 754
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914963-->
END%%
%%ANKI
Basic
How are digits left of a decimal point weighted?
Back: As a nonnegative power of $10$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914965-->
END%%
%%ANKI
Basic
How are digits right of a decimal point weighted?
Back: As negative powers of $10$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914967-->
END%%
%%ANKI
Basic
How are digits left of a binary point weighted?
Back: As a nonnegative power of $2$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914969-->
END%%
%%ANKI
Basic
How are digits right of a binary point weighted?
Back: As a negative power of $2$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914971-->
END%%
%%ANKI
Basic
What is the decimal expansion of binary $10.11_2$?
Back: $2^1 + 2^{-1} + 2^{-2} = 2.75$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914973-->
END%%
%%ANKI
Basic
What decimal value does $0.1111_2$ evaluate to?
Back: $\frac{15}{16}$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914975-->
END%%
%%ANKI
Basic
What decimal value does $0.11_2$ evaluate to?
Back: $\frac{3}{4}$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914977-->
END%%
%%ANKI
Basic
What decimal value does $0.11\cdots1_2$ evaluate to?
Back: Given $n$ $1$'s, $1 - 2^{-n}$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914980-->
END%%
%%ANKI
Basic
What visualization explains why $0.11\cdots1_2 = 1 - 2^{-n}$?
Back: Each additional $1$ halves the remaining interval.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914982-->
END%%
%%ANKI
Basic
What is the result of shifting the decimal point of $d_m \cdots d_1 d_0 . d_{-1} d_{-2} \cdots d_{-n}$ to the left?
Back: Division by $10$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914984-->
END%%
%%ANKI
Basic
What is the result of shifting the decimal point of $d_m \cdots d_1 d_0 . d_{-1} d_{-2} \cdots d_{-n}$ to the right?
Back: Multiplication by $10$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914986-->
END%%
%%ANKI
Basic
What is the result of shifting the binary point of $b_m \cdots b_1 b_0 . b_{-1} b_{-2} \cdots b_{-n}$ to the right?
Back: Multiplication by $2$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914990-->
END%%
%%ANKI
Basic
What is the result of shifting the binary point of $b_m \cdots b_1 b_0 . b_{-1} b_{-2} \cdots b_{-n}$ to the left?
Back: Division by $2$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914993-->
END%%
%%ANKI
Basic
What binary pattern does $1 - \epsilon$ denote?
Back: $0.11\cdots1$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914995-->
END%%
%%ANKI
Basic
What compact notation is used to denote $0.11\cdots1_2$?
Back: $1 - \epsilon$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556914997-->
END%%
%%ANKI
Basic
What compact notation is used to denote $1.11\cdots1_2$?
Back: $2 - \epsilon$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915000-->
END%%
%%ANKI
Basic
What name is given to the $.$ in decimal number $d_m \cdots d_1 d_0 . d_{-1} d_{-2} \cdots d_{-n}$?
Back: The decimal point.
<!--ID: 1710556915002-->
END%%
%%ANKI
Basic
What name is given to the $.$ in binary number $b_m \cdots b_1 b_0 . b_{-1} b_{-2} \cdots b_{-n}$?
Back: The binary point.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915004-->
END%%
%%ANKI
Cloze
The IEEE floating-point standard represents numbers in form {1:$(-1)^s$} $\times$ {1:$M$} $\times$ {1:$2^E$}.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915006-->
END%%
%%ANKI
Basic
What term is used to refer to $s$ in IEEE floating-point $(-1)^s \times M \times 2^E$?
Back: The sign.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915008-->
END%%
%%ANKI
Basic
What term is used to refer to $M$ in IEEE floating-point $(-1)^s \times M \times 2^E$?
Back: The significand.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915009-->
END%%
%%ANKI
Basic
What range of values does the significand $M$ take on in IEEE floating-point?
Back: Between $1$ and $2 - \epsilon$ or between $0$ and $1 - \epsilon$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915012-->
END%%
%%ANKI
Basic
What term is used to refer to $E$ in IEEE floating-point $(-1)^s \times M \times 2^E$?
Back: The exponent.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915014-->
END%%
%%ANKI
Basic
The bit representation of a floating-point number is divided into what three fields?
Back: The sign, exponent, and fraction.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915016-->
END%%
%%ANKI
Basic
How many bits make up the sign field of a `float`?
Back: `1`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556915017-->
END%%
%%ANKI
Basic
How many bits make up the exponent field of a `float`?
Back: `8`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556915019-->
END%%
%%ANKI
Basic
How many bits make up the fraction field of a `float`?
Back: `23`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556915022-->
END%%
%%ANKI
Basic
How many bits make up the sign field of a `double`?
Back: `1`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556915024-->
END%%
%%ANKI
Basic
How many bits make up the exponent field of a `double`?
Back: `11`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556915026-->
END%%
%%ANKI
Basic
How many bits make up the fraction field of a `double`?
Back: `52`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556915028-->
END%%
%%ANKI
Cloze
The exponent field of a `float` has {`8`} bits and a `double` has {`11`} bits.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556915030-->
END%%
%%ANKI
Cloze
The fraction field of a `float` has {`23`} bits and a `double` has {`52`} bits.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556915032-->
END%%
%%ANKI
Basic
Which IEEE floating-point fields have the same width in `float`s and `double`s?
Back: The sign bit field.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556915034-->
END%%
%%ANKI
Basic
Which IEEE floating-point fields have different widths in `float`s and `double`s?
Back: The exponent and fraction fields.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556915036-->
END%%
%%ANKI
Basic
When is a floating-point number considered normalized?
Back: When the exponent field is neither all `0`s nor all `1`s.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915038-->
END%%
%%ANKI
Basic
What distinguishes the exponent *field* from the exponent *value*?
Back: The latter refers to the value after biasing the unsigned interpretation of the former.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915040-->
END%%
%%ANKI
Basic
What does the bias refer to?
Back: The number used to adjust the interpreted value of the exponent field.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915042-->
END%%
%%ANKI
Basic
What is the value of the bias?
Back: Given $k$ bits in the exponent field, $2^{k-1} - 1$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915044-->
END%%
%%ANKI
Basic
How do you determine the exponent *value* in normalized form?
Back: $e - Bias$ where $e$ is the unsigned interpretation of the exponent field.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915046-->
END%%
%%ANKI
Basic
How do you determine the significand value in normalized form?
Back: It equals $1$ plus the fraction field.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915048-->
END%%
%%ANKI
Cloze
A sign bit value of {1:$0$} is positive and {1:$1$} is negative.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915051-->
END%%
%%ANKI
Basic
Which floating-point field is the bias relevant to?
Back: The exponent field.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915053-->
END%%
%%ANKI
Basic
How do you determine the sign of a normalized floating-point?
Back: A sign bit of $0$ is positive, a sign bit of $1$ is negative.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915055-->
END%%
%%ANKI
Basic
For which floating-point form is "implied leading $1$" relevant?
Back: Normalized form.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915057-->
END%%
%%ANKI
Basic
Which floating-point form is depicted in the following?
![[normalized-form.png]]
Back: Normalized form.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915059-->
END%%
%%ANKI
Basic
When is a floating-point number considered denormalized?
Back: When the exponent field is either all `0`s or all `1`s.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915061-->
END%%
%%ANKI
Basic
How do you determine the exponent *value* in denormalized form?
Back: $1 - Bias$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915063-->
END%%
%%ANKI
Basic
How do you determine the significand value in denormalized form?
Back: It equals the fraction field.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915065-->
END%%
%%ANKI
Basic
Is value $0$ representable in normalized form?
Back: No.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915067-->
END%%
%%ANKI
Basic
Is value $0$ representable in denormalized form?
Back: Yes.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915069-->
END%%
%%ANKI
Basic
Which floating-point form corresponds to very large numbers ($|V| \gg 0$)?
Back: Normalized form.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915071-->
END%%
%%ANKI
Basic
Which floating-point form corresponds to near $0$ numbers ($|V| \ll 1$)?
Back: Denormalized form.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915073-->
END%%
%%ANKI
Cloze
{1:$|V| \ll 1$} is to {2:denormalized} form whereas {2:$|V| \gg 0$} is to {1:normalized} form.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915075-->
END%%
%%ANKI
Cloze
Significand range {$[0, 1 - \epsilon]$} is to denormalized whereas {2:$[1, 2 - \epsilon]$} is to normalized.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710605798314-->
END%%
%%ANKI
Basic
*Why* can't normalized floating-point encode $0$?
Back: Because of the implied leading $1$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915077-->
END%%
%%ANKI
Basic
Which number can be encoded in two different ways?
Back: $0$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915079-->
END%%
%%ANKI
Basic
In what two ways can $0$ be encoded?
Back: As $-0.0$ or $+0.0$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915080-->
END%%
%%ANKI
Basic
What is the actual bit encoding of floating-point number $+0.0$?
Back: All `0`s.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915082-->
END%%
%%ANKI
Basic
What is the actual bit encoding of floating-point number $-0.0$?
Back: A sign bit `1` followed by all `0`s.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915084-->
END%%
%%ANKI
Basic
Which floating-point form is depicted in the following?
![[denormalized-form.png]]
Back: Denormalized form.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915086-->
END%%
%%ANKI
Basic
What is the actual bit encoding of floating-point number $+\infty$?
Back: Sign bit `0`, exponent field of all `1`s, a fractional field of all `0`s.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915088-->
END%%
%%ANKI
Basic
What is the actual bit encoding of floating-point number $-\infty$?
Back: Sign bit `1`, exponent field of all `1`s, a fractional field of all `0`s.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915090-->
END%%
%%ANKI
Basic
What is the actual bit encoding of floating-point number $NaN$?
Back: An exponent field of all `1`s and a non-zero fractional field.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915092-->
END%%
%%ANKI
Basic
What value is encoded in the following image?
![[infinity.png]]
Back: Infinity.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915094-->
END%%
%%ANKI
Basic
What value is encoded in the following image?
![[nan.png]]
Back: Not-a-number.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915096-->
END%%
%%ANKI
Cloze
{1:$e - Bias$} is to {2:normalized} form whereas {2:$1 - Bias$} is to {1:denormalized} form.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915098-->
END%%
%%ANKI
Basic
Which form corresponds to exponent value $e - Bias$, where $e$ is the unsigned interpretation of the exponent field?
Back: Normalized form.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915100-->
END%%
%%ANKI
Basic
In normalized form's exponent value $e - Bias$, what does $e$ refer to?
Back: The unsigned interpretation of the exponent field.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915102-->
END%%
%%ANKI
Basic
Which form corresponds to exponent value $1 - Bias$?
Back: Denormalized form.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915104-->
END%%
%%ANKI
Basic
*Why* is denormalized form's exponent value defined as $1 - Bias$?
Back: It provides a smooth transition between values in normalized and denormalized form.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710556915106-->
END%%
%%ANKI
Basic
What is the first integer value not exactly representable by a `float`?
Back: $2^{24} + 1$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710605798317-->
END%%
%%ANKI
Basic
What is the first integer value not exactly representable by a `double`?
Back: $2^{53} + 1$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710605798319-->
END%%
%%ANKI
Basic
What is the first integer value not exactly representable by an IEEE floating-point number?
Back: Given $n > 0$ fractional bits, $2^{n + 1} + 1$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710605798321-->
END%%
%%ANKI
Basic
Given $n > 0$ fractional bits, *why* is $2^{n+1} + 1$ the first integer value not exactly representable?
Back: There exists a maximum of $n + 1$ significant digits in the significand.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710605798323-->
END%%
%%ANKI
Basic
What is the bit representation of the largest normalized positive `float`?
Back: Sign bit `0`, exponent field $11 \cdots 10_2$, fraction field all `1`s.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710605798325-->
END%%
%%ANKI
Basic
What is the bit representation of the smallest positive `float`?
Back: Sign bit `0`, exponent field `0`s, fraction field $00 \cdots 01_2$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710607581719-->
END%%
%%ANKI
Basic
What is the bit representation of the smallest normalized positive `float`?
Back: Sign bit `0`, exponent field $00 \cdots 01_2$, fraction field all `0`s.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710605798329-->
END%%
%%ANKI
Basic
Let `float x = 1.0`. What is the bit representation of `x`'s exponent *field*?
Back: `01111111`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710605798327-->
END%%
%%ANKI
Basic
Let `double x = 1.0`. What is the bit representation of `x`'s exponent *field*?
Back: `01111111111`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710605798331-->
END%%
%%ANKI
Basic
What is the bit representation of the largest normalized positive `double`?
Back: Sign bit `0`, exponent field $11 \cdots 10_2$, fraction field all `1`s.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710605798333-->
END%%
%%ANKI
Basic
What is the bit representation of the smallest normalized positive `double`?
Back: Sign bit `0`, exponent field $00 \cdots 01_2$, fraction field all `0`s.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710605798335-->
END%%
%%ANKI
Basic
What is the bit representation of the smallest positive `double`?
Back: Sign bit `0`, exponent field all `0`s, fraction field $00 \cdots 01_2$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710607581722-->
END%%
%%ANKI
Basic
What is the largest unsigned interpretation of a `float`'s exponent *field*?
Back: $2^8 - 2$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710605798337-->
END%%
%%ANKI
Basic
What is the smallest positive `float` that can be exactly represented?
Back: $2^{-23}$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710607581724-->
END%%
%%ANKI
Basic
What is the largest unsigned interpretation of a `double`'s exponent field?
Back: $2^{11} - 2$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710605798339-->
END%%
%%ANKI
Basic
What is the smallest positive `double` that can be exactly represented?
Back: $2^{-52}$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710607581726-->
END%%
%%ANKI
Basic
What is the smallest positive IEEE floating-point number that can be exactly represented?
Back: Given $n$ fractional bits, $2^{-n}$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710607730820-->
END%%
%%ANKI
Basic
What range does the exponent *value* take on in normalized form?
Back: Integer values in closed interval $[1 - Bias, Bias]$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710605798341-->
END%%
%%ANKI
Basic
What range does the exponent *value* take on in denormalized form?
Back: The exponent always evaluates to $1 - Bias$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710605798343-->
END%%
%%ANKI
Basic
What is the signficance of term $1$ in "the smallest normalized exponent *value* is $1 - Bias$"?
Back: The smallest unsigned interpretation of a normalized exponent field is $1$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710605798345-->
END%%
%%ANKI
Basic
How does the largest unsigned interpretation of the exponent *field* relate to the $Bias$?
Back: The largest unsigned interpretation is $2 \times Bias$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710605798347-->
END%%
%%ANKI
Basic
How does the largest exponent *value* relate to the $Bias$?
Back: It equals $Bias$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710605798350-->
END%%
%%ANKI
Basic
How does the smallest exponent *value* relate to the $Bias$?
Back: It equals $1 - Bias$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1710605798354-->
END%%
## References
* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
* “Scientific Notation.” In _Wikipedia_, March 6, 2024. [https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750](https://en.wikipedia.org/w/index.php?title=Scientific_notation&oldid=1212169750).

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -1,9 +1,10 @@
---
title: Integer Encoding
TARGET DECK: Obsidian::STEM
FILE TAGS: binary
FILE TAGS: binary::integer
tags:
- binary
- integer
---
## Overview