| Which (one or more) of the fol... | |||||||
|
30 Day Risk-Free Guarantee:
100% money back if you're unsatisfied. Book (308 Pages):
![]() Video (One Hour):
![]() Resume Review (24 - 48hr)
All Products / Services
|
|||||||
Which (one or more) of the following numbers can't be represented accurately in binary?
0.1, 319, 63.5, 1/16, 1.32, 5.390625
13
Hey PP, can you please explain or direct me to an appropriate link?
Can you please justify your answer?
.1 binary comes to be 0, 1.32 becomes repeating after some time. but similarly, 63.5 and 63 has binary = 111111, 5.390625 and 5 equals 101 in binary. difficult to say that 63.5 and 5.390625 can be represented accurately.
pp is right because:
0.1 = 1/10. it's not possible to get a combination of powers of (1/2) that add up to 1/10.
1.32 = similarly, 32/100 = 8/25. that number cannot be expressed as a sum of powers of (1/2) either.
@rts; so is that the general rule to find if a number can be represented exactly in binary ? .. see if it can be represented as a sum of powers if (1/2)
except 319, other integers can not be represent in binary correctly. I have conclude this using calculator.
To convert numbers between 0 and 1, take the decimal expression and repeat-
edly multiply it by 2. At each step, keep track of the integer part of the
result but do not carry it along in subsequent multiplications. For
example, convert decimal 0.7 to binary:
0.7 * 2 = 1.4
0.4 * 2 = 0.8
0.8 * 2 = 1.6
0.6 * 2 = 1.2
0.2 * 2 = 0.4
0.4 * 2 = 0.8
0.8 * 2 = 1.6
0.6 * 2 = 1.2 etc. Note that we have started to repeat previous
results. Now read the integer parts occurring on
the right side, from the top down: the binary
representation of decimal 0.7 is 0.1011001100...
where the "1100" repeats forever.
so whatever number after decimal ends in 5 will become 0 eventually following above procedure and wil not be non-repeating..... therefore can be represented accurately.
319 (or 319.0), 63.5, 1/16(or 0.0625), 5.390625 can be represented accuratley in binary.
good
How 5.390625 can be expressed in binary...
5.390625 should be 101.011001
Online calculator to convert floating point number to binary. Quite useful!
http://babbage.cs.qc.cuny.edu/IEEE-754/Decimal.html
319, 63.5, 1/16, 5.390625 can be represented accurately.
0.1, 1.32 can't be.