as.integer(2^31)
[1] NA
2^31
[1] 2147483648
(2^31)*(2^31)
[1] 4.611686e+18
(x <- 2^8 - 1)
[1] 255
x/2
[1] 127.5
1.75*2^(-120)
[1] 1.316554e-36
\[ \begin{align*} x & = (8 + f) \times 10^{-3} \\ f & = 0.72 \end{align*} \]
\[ \begin{align*} x & = (-1)^s10^n(d + f) \\ 0 & < d \leq9 \\ 0 & \leq f < 1 \end{align*} \]
\[ x = (-1)^{s}2^{n}(1 + f) \]
\[ x = (-1)^s2^{c-127}(1 + f) \]
(x <- 2^8 - 1)
[1] 255
x/2
[1] 127.5
\[ x = (-1)^{s} 2^{n} (1 + f) \]
\[ x = (-1)^s 2^{c-1023} (1 + f) \]
(x <- 2^11 - 1)
[1] 2047
x/2
[1] 1023.5
\[ x = (0)(10100001)(01100...0) \]
\[ (-1)^s 2^{c-127} (1+f) \]
\[ x = (0)(10100001)(01100...0) \]
(s <- 0)
[1] 0
\[ x = (0)(10100001)(01100...0) \]
(c <- 1*2^7+0*2^6+1*2^5+0*2^4+0*2^3+0*2^2+0*2^1+1*2^0)
[1] 161
(p <- c - 127)
[1] 34
\[ x = (0)(10100001)(01100...0) \]
(f <- 0*(1/2)+1*(1/2)^2+1*(1/2)^3+0*(1/2)^4)
[1] 0.375
\[ \begin{align*} x &= (-1)^0 2^{34} (1+0.375) \Leftarrow \mathrm{Answer} \\ & = 1.375 \times 2^{34} \end{align*} \]
(x <- (-1)^s*2^p*(1+f))
[1] 23622320128
\[ x = (1)(01010010)(100100...0) \]
\[ (-1)^s 2^{c-127} (1+f) \]
\[ x = (1)(01010010)(100100...0) \]
\[ x = (1)(01010010)(100100...0) \]
(s <- 1 )
[1] 1
Given \( x = (1)(01010010)(100100...0) \)
Find characteristic \( c \) and power \( p = c - 127 \):
Given \( x = (1)(01010010)(100100...0) \)
Find characteristic \( c \) and power \( p = c - 127 \):
\[ \]
\[ \]
c <- 1*2^7+0*2^6+1*2^5+0*2^4+0*2^3+0*2^2+0*2^1+1*2^0
Given \( x = (1)(01010010)(100100...0) \)
Find characteristic \( c \) and power \( p = c - 127 \):
(c <- 0*2^7+1*2^6+0*2^5+1*2^4+0*2^3+0*2^2+1*2^1+0*2^0)
(p <- c - 127)
Given \( x = (1)(01010010)(100100...0) \)
Find characteristic \( c \) and power \( p = c - 127 \):
(c <- 0*2^7+1*2^6+0*2^5+1*2^4+0*2^3+0*2^2+1*2^1+0*2^0)
[1] 82
(p <- c - 127)
[1] -45
Given \( x = (1)(01010010)(100100...0) \)
Determine mantissa \( f \):
Given \( x = (1)(01010010)(100100...0) \)
Determine mantissa \( f \):
\[ \]
\[ \]
f <- 0*(1/2)+1*(1/2)^2+1*(1/2)^3+0*(1/2)^4
Given \( x = (1)(01010010)(100100...0) \)
Determine mantissa \( f \):
(f <- 1*(1/2)+0*(1/2)^2+0*(1/2)^3+1*(1/2)^4)
Given \( x = (1)(01010010)(100100...0) \)
Determine mantissa \( f \):
(f <- 1*(1/2)+0*(1/2)^2+0*(1/2)^3+1*(1/2)^4)
[1] 0.5625
\[ \]
(x <- (-1)^s*2^p*(1+f))
\[ \begin{align*} x &= (-1)^1 2^{-45} (1+0.5625) \Leftarrow \mathrm{Answer} \\ & = - 1.5625 \times 2^{-45} \end{align*} \]
(x <- (-1)^s*2^p*(1+f))
[1] -4.440892e-14
\[ 1000 = 0b1111101000 * 2^9 \]
\[ x = (-1)^{s}2^{p}(1 + f) \]
(f <- 1*(1/2) + 1*(1/2)^2 + 1*(1/2)^3 + 1*(1/2)^4 + 1*(1/2)^5 + 0*(1/2)^6 + 1*(1/2)^7)
[1] 0.9765625
(1+f)*2^9
[1] 1012
\[ 1000 = 0b111101000 * 2^9 \]
\[ 1000 = 0b1111101000 * 2^9 \]
\[ x = (-1)^{s}2^{p}(1 + f) \]
(f <- 1*(1/2) + 1*(1/2)^2 + 1*(1/2)^3 + 1*(1/2)^4 + 0*(1/2)^5 + 1*(1/2)^6 + 0*(1/2)^7)
[1] 0.953125
(1+f)*2^9
[1] 1000
\[ 0.75 = 0b0001 * 2^{-1} \]
\[ x = (-1)^{s}2^{p}(1 + f) \]
(f <- 0*(1/2) + 0*(1/2)^2 + 0*(1/2)^3 + 1*(1/2)^4 )
[1] 0.0625
(1+f)*2^(-1)
[1] 0.53125
\[ 0.75 = 0b1000 * 2^{-1} \]
\[ 0.75 = 0b0001 * 2^{-1} \]
\[ x = (-1)^{s}2^{p}(1 + f) \]
(f <- 1*(1/2) + 0*(1/2)^2 + 0*(1/2)^3 + 0*(1/2)^4)
[1] 0.5
(1+f)*2^(-1)
[1] 0.75
\[ 0.75 = 0b1000 * 2^{-1} \]
The author explains that “there is only one digit included because the initial digit is implicit. Therefore this number is \( 0b0.11 \) in binary.”
For the implicit initial digit, the author is probably referring to the 1 in the \( 1+f \).
For the \( 0b0.11 \), the author is probably referring to
\[ 1*(1/2) + 1*(1/2)^2 = 0.75 \]