Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Explain why a 4-byte float has an upper bound of 10 38 as depicted in Figure 2.1

ID: 3679384 • Letter: E

Question

Explain why a 4-byte float has an upper bound of 1038 as depicted in Figure 2.1 of your text?

FIGURE 2.1 Primitive Type Type Name Kind of Value byte short int long Memory Used Range of Values 1 byte 2 bytes 4 bytes 8 bytes 128 to 127 32,768 to 32,767 2,147,483,648 to 2,147,483,647 9,223,372,036,8547,75,808 to 9,223,372,036,854,775,807 ±3.40282347 x 10+38 to ±1.40239846× 10-45 ± 1.7976931 3486231 570 x 10+308 to ±4.94065 645 841 246544 1 0-324 All Unicode values from 0 to 65,535 Integer Integer Integer Integer float Floating-point 4 bytes double Floating-poin 8 bytes char Single character 2 bytes (Unicode) boolean 1 bit True or false

Explanation / Answer

The data type float uses IEEE 32-bit single precision format. A floating-point constant is treated as a double precision number by GCC.There are 4294967296 patterns for any 32-bit format.

The normalized significand is 1.m (binary dot). The binary point is before bit-22 and the 1 (one) is not present explicitly. • The sign bit s = 1 for a ve number is zero (0) for a +ve number. • The value of a normalized number is

(-1)s x 1.m x 2 e-127

The smallest magnitude of a normalized number in single precession is ± 0000 0001 000 0000 0000 0000 0000 0000, whose value is 1.0 × 2 126 . • The largest magnitude of a normalized number in single precession is ± 1111 1110 111 1111 1111 1111 1111 1111,

whose value is 1.99999988 × 2127 3.403 × 1038 .

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote