Solution:
Step 1: What is double precision?
i) The term double precision is something of a misnomer because the precision is not really double. The word double derives from the fact that a double-precision number uses twice as many bits as a regular floating-point number. For example, if a single-precision number requires 32 bits, its double-precision counterpart will be 64 bits long.
ii) Double-precision floating-point format (sometimes called FP64) is a computer number format, usually occupying 64 bits in computer memory; it represents a wide dynamic range of numeric values by using a floating radix point.
iii) Floating point is used to represent fractional values, or when a wider range is needed than is provided by fixed point (of the same bit width), even if at the cost of precision. Double precision may be chosen when the range or precision of single precision would be insufficient.
iv) In the IEEE 754-2008 standard, the 64-bit base-2 format is officially referred to as binary64; it was called double in IEEE 754-1985. IEEE 754 specifies additional floating-point formats, including 32-bit base-2 single precision and, more recently, base-10 representations.
Step 2: realmax : Largest positive floating-point number
Syntax:
f = realmax
f = realmax(precision)
description:
returns the largest finite floating-point
number in IEEE® double precision. This is equal to
i)f
=
realmax(2-2^(-52))*2^1023
.
ii)
returns the largest
finite floating-point number in IEEE single or double precision.
This is equal to f
=
realmax(precision
)realmax
for double precision, and to
single((2-2^(-23))*2^127)
for single precision.
Step 3: Example
Double-precision binary floating-point is a commonly used format on PCs, due to its wider range over single-precision floating point, in spite of its performance and bandwidth cost. It is commonly known simply as double. The IEEE 754 standard specifies a binary64 as having:
i) The sign bit determines the sign of the number (including when this number is zero, which is signed).
ii) The exponent field is an 11-bit unsigned integer from 0 to 2047, in biased form: an exponent value of 1023 represents the actual zero. Exponents range from −1022 to +1023 because exponents of −1023 (all 0s) and +1024 (all 1s) are reserved for special numbers.
iii) The 53-bit significand precision gives from 15 to 17 significant decimal digits precision (2−53 ≈ 1.11 × 10−16). If a decimal string with at most 15 significant digits is converted to IEEE 754 double-precision representation, and then converted back to a decimal string with the same number of digits, the final result should match the original string. If an IEEE 754 double-precision number is converted to a decimal string with at least 17 significant digits, and then converted back to double-precision representation, the final result must match the original number.
Get Answers For Free
Most questions answered within 1 hours.