Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Floating-point number?

Ook bekend als: sign (floating-point) · exponent (floating-point) · significand

Definition 4.2 High School Computer Science · Hoofdstuk 4 — Floating-Point Numbers

A floating-point number is a number written ±m×2e\pm m \times 2^{e}, where the sign is ++ or −-, the exponent ee is a whole number, and the significand mm is a binary fraction with 1≤m<21 \le m < 2 and a fixed number of digits. Each of the three parts is stored in a fixed number of bits.

The 64 bits of the stored 0.1: sign 0; exponent field 1019, that is e = 1019 - 1023 = -4; fraction bits 1001\,1001 … 1010. The value is 1.1001\,1001…1010 × 2-4 in base 2. The last digits … 1010 instead of … 1001\,1001 show that the digits were rounded up.
The 6464 bits of the stored 0.1: sign 00; exponent field 10191019, that is e=1019−1023=−4e = 1019 - 1023 = -4; fraction bits 1001 1001…10101001\,1001 \dots 1010. The value is 1.1001 1001…1010×2−41.1001\,1001\dots1010 \times 2^{-4} in base 22. The last digits …1010\dots 1010 instead of …1001 1001\dots 1001\,1001 show that the digits were rounded up.
The 128 values of the toy format on a number line. There are as many values between 16 and 31 as between 1/8 and 1/4: floating-point numbers keep the same number of significant digits, not the same number of digits after the point.
The 128128 values of the toy format on a number line. There are as many values between 1616 and 3131 as between 18\tfrac18 and 14\tfrac14: floating-point numbers keep the same number of significant digits, not the same number of digits after the point.
Lees in het hoofdstuk →