Im having a debate between me and my study group regarding a question of numerical representation.
$x = 0.002718281828459$, $\beta = 10$, $p = 6$ We are told to find $\text{fl}(x)$, $\beta$ is base and $p$ is precision just to clarify. I found the answer to be: $\text{fl}(x) = 271.828 \times 10^{-3}$ and the $\text{error} = .1828459 \times 10^{-7}$.
They have: $\text{fl}(x) = 2.71828 \times 10^{-5}$ with an $\text{error} = .1828459 \times 10^{-8}$
My study group believes it be okay to truncate the two leading zeros after the decimal point so their $x$ value is $.2718281828459$. I contend that that changes the value of the entity and is therefore wrong.
The rationale for my argument is that, you move the decimal 6 places starting where it is at and you get $271.XXX$ with $p = 6$ you need a total of $6$ digits, the first three are $271$, the next are $.828$ The values of $10^{-3}$ is from the amount of digits after $271$ of which there are three, and the $10^{-7}$ is form the position of the leading value in $.1828459$.
There is insufficient information to determine the floating point representation of the number $x$. To that end, we require the permitted range of exponents.
It is entirely possible to select a range of exponents, such that $x$ can only be represented as a subnormal number with less than $p$ significant figures, see below.
As we are only given the base $\beta=10$ and the precision $p=6$, the real issue is to round $x$ correctly. A useful first step is to write $x = 0.002718281828459$ using normalized scientific notation, i.e., $$ x = 2.718281828459 \times 10^{-3}.$$ This immediately reveals the magnitude of $x$ and we can count 13 significant figures. We now round $x$ to $p=6$ significant figures and obtain $$\bar{x} = 2.71828 \times 10^{-3}.$$ The error is $$x - \bar{x} = 0.000001828459 \times 10^{-3} = 1.828459 \times 10^{-9}.$$
Now suppose that our hypothetical computer has a smallest exponent of 0. Then $x$ is substantially smaller than $1$, our smallest positive normal floating point number and we must either flush $x$ to zero or use a subnormal number to represent $x$, i.e. $$ \hat{x} = 0.00272 \times 10^0.$$ Here 3 figures of the significand have been sacrificed to allow for a nonzero representation of $x$.