Source: Foundations of Computer Science, Ch. 3 (Sections 3.6 -- 3.7)
Tags: binary fractions, radix point, fractional conversion, mixed number conversion, binary point, decimal point, repeating fractions, IFT 510, Purdue
Difficulty: Intermediate to Advanced
Prerequisites: Number Systems and Bases study notes, Arithmetic and Conversion study notes (Ch. 3, Sections 3.0 -- 3.5)
Everything you have learnt about integer base conversion extends to fractions, but with one important wrinkle: a fraction that terminates in one base may repeat endlessly in another. This matters because computers store numbers in binary with a fixed number of bits, so many common decimal fractions (like 0.1) cannot be represented exactly. This is the root cause of floating-point rounding errors that affect every programming language. Understanding how fractional weights work on both sides of the radix point is essential preparation for Chapter 5 on numeric data representation.
Digits to the right of the radix point have fractional weights: 1/B, 1/B^2, 1/B^3, and so on. Converting fractional parts between bases uses the same weight-summing logic as integers, but the conversion from decimal to another base uses successive multiplication instead of successive division. Not all fractions convert exactly; when they do not, you truncate at the desired accuracy.
Radix point
The general term for the dot separating the integer part from the fractional part of a number. Called a "decimal point" in base 10, a "binary point" in base 2, a "hexadecimal point" in base 16. In simple terms, the dot. Its name changes depending on which base you are in.
Binary point
The radix point in a base 2 number. Digits to its left have weights 1, 2, 4, 8, etc. Digits to its right have weights 1/2, 1/4, 1/8, 1/16, etc.
Repeating fraction
A fraction whose digits in a given base cycle endlessly without terminating. The decimal fraction 0.1 becomes the repeating binary fraction 0.0001100110011... (a four-bit repeating cycle). In simple terms, some fractions simply cannot be written with a finite number of digits in certain bases.
Fractional conversion
The process of converting the part of a number to the right of the radix point from one base to another. Handled separately from the integer part.
Mixed number
A number with both an integer part and a fractional part (e.g. 27.625). The integer and fractional parts must be converted independently; the radix point stays fixed.
To the right of the radix point, each successive position has a weight of 1/B times the position to its left.
In base 10:
.D1 D2 D3 D4
1/10 1/100 1/1000 1/10000
In base 2:
.B1 B2 B3 B4 B5 B6
1/2 1/4 1/8 1/16 1/32 1/64
So the binary fraction 0.101011 equals:
1/2 + 0/4 + 1/8 + 0/16 + 1/32 + 1/64
= 0.5 + 0.125 + 0.03125 + 0.015625
= 0.671875
The decimal fraction 0.1 (one tenth) has no exact binary representation. In binary it becomes:
0.0001100110011... (repeating)
This is because there is no combination of powers of 1/2 that sums exactly to 1/10. This is analogous to how 1/3 has no exact decimal representation (0.3333...) but is exactly 0.1 in base 3.
The rule: fractions of the form 1/2^k always convert exactly to decimal (because 1/2^k is a terminating decimal). But fractions of the form 1/10^k do not generally convert exactly to binary.
Method: Positional weights
Same as for integers. Multiply each fractional digit by its weight and sum.
Example, convert 0.12201 (base 3) to decimal:
Weights: 1/3, 1/9, 1/27, 1/81, 1/243
1x(1/3) + 2x(1/9) + 2x(1/27) + 0x(1/81) + 1x(1/243)
= 0.33333 + 0.22222 + 0.07407 + 0 + 0.00412
= 0.63374
Alternative: shift-and-divide trick
Shift the radix point to the right to make the fraction a whole number, convert that whole number to decimal, then divide by B^(number of places shifted).
Example, convert 0.110011 (binary) to decimal:
Shift 6 places right: 110011 (binary) = 32+16+2+1 = 51
Divide by 2^6 = 64
Result: 51/64 = 0.796875
Method: Successive multiplication
Multiply the fraction by the target base. The integer part of the result is the next fractional digit. Take the remaining fractional part and repeat.
Example, convert 0.1 (decimal) to binary:
0.1 x 2 = 0.2 → digit 0
0.2 x 2 = 0.4 → digit 0
0.4 x 2 = 0.8 → digit 0
0.8 x 2 = 1.6 → digit 1
0.6 x 2 = 1.2 → digit 1
0.2 x 2 = 0.4 → digit 0 (cycle begins again)
0.4 x 2 = 0.8 → digit 0
...
Result: 0.000110011... (repeating)
Stop when you have enough precision or when the fraction reaches exactly 0.
The same binary-to-hex and binary-to-octal grouping works for fractions, but you group from left to right (starting at the radix point), not right to left.
Example, convert 0.1011 (binary) to octal:
Group by threes from the radix point rightward: 101 100 (pad with trailing zero)
Convert: 5 4
Result: 0.54 (octal)
Example, hex representation of 0.1 (decimal) in binary:
0.0001 1001 1001 1001... (binary)
Group by fours from radix point: 0001 1001 1001 1001...
Convert: 1 9 9 9...
Result: 0.1999... (hex, repeating)
When a number has both an integer and a fractional part (e.g. 27.625), you must convert the two parts independently. The radix point does not move.
Convert the integer part (27) using any integer conversion method.
Convert the fractional part (0.625) using the fractional weights or successive multiplication method.
Combine the results with the radix point between them.
A common error is to shift the radix point to make the whole thing an integer, convert, then try to shift back. This fails because shifting in base 2 multiplies/divides by powers of 2, not powers of 10. The shift factor is different in the two bases. Just convert the parts separately.
Fractional positional value:
Value of digit at position -k = digit x (1 / B^k)
Shift-and-divide shortcut:
Treat fraction as integer by shifting n places right
Convert that integer to decimal
Divide by B^n
Floating-point arithmetic in every programming language (JavaScript, Python, Java, C) uses binary fractions internally. The fact that 0.1 cannot be represented exactly in binary is why 0.1 + 0.2 does not equal 0.3 in JavaScript. Financial software typically avoids binary floating-point for this reason, using decimal-based representations instead.
Students often assume that all simple decimal fractions (0.1, 0.2, 0.3) have exact binary equivalents. They do not. Only fractions whose denominator is a power of 2 convert exactly.
Confusing the grouping direction for fractions: for integers, group bits from right to left; for fractions, group from left to right (from the radix point outward in both cases).
Trying to convert a mixed number by shifting the decimal point, converting the whole thing as an integer, and shifting back in the new base. This does not work because the shift factor depends on the base.
Forgetting that when a fractional conversion does not terminate, you simply stop at the desired number of digits. There is no error in truncating; it is expected.
⚠️ Know the binary fractional weights: 1/2, 1/4, 1/8, 1/16, 1/32, 1/64. Be prepared to convert a short binary fraction to decimal by summing these.
⚠️ The fact that 0.1 (decimal) is a repeating binary fraction is a classic exam question.
⚠️ Mixed number conversions require separate handling of integer and fractional parts. The radix point is the fixed reference. This is explicitly tested.
⚠️ Fractional grouping for binary-to-octal goes left to right with trailing zero padding (not leading zeros as with integer grouping).
1. True or false: The binary fraction 0.101 equals 0.625 in decimal. True. 1/2 + 0/4 + 1/8 = 0.5 + 0.125 = 0.625.
2. Fill in the blank: 0.1 in decimal is a ______ fraction in binary. Repeating (specifically 0.000110011... repeating).
3. True or false: To convert the fractional part of a decimal number to binary, you use successive division. False. You use successive multiplication by 2.
4. Fill in the blank: When grouping binary fraction digits for octal conversion, you group from ______ to ______ starting at the radix point. Left to right.
5. True or false: A fraction that is exact in base 2 is always exact in base 10. True. Every power of 1/2 has an exact decimal representation.
Q: Convert the binary fraction 0.1001001 to decimal.
A: 1/2 + 0 + 0 + 1/16 + 0 + 0 + 1/128 = 0.5 + 0.0625 + 0.0078125 = 0.5703125
Q: Convert 0.625 (decimal) to binary.
A: 0.625 x 2 = 1.25 (digit 1). 0.25 x 2 = 0.5 (digit 0). 0.5 x 2 = 1.0 (digit 1). Fraction is now 0, so stop. Result: 0.101 (binary).
Q: Why does 0.1 + 0.2 not equal exactly 0.3 in most programming languages?
A: Because 0.1 and 0.2 cannot be represented exactly in binary. Each introduces a tiny rounding error. When added, the errors accumulate, producing a result very slightly different from 0.3.
Q: Convert the binary number 0.1011 to octal.
A: Group by threes from the radix point: 101 100 (pad trailing zero). Convert: 5, 4. Result: 0.54 (octal).
This section leads directly into Chapter 5's coverage of floating-point number representation (IEEE 754), where the binary fraction forms the mantissa of a floating-point number. It also connects to data compression (Chapter 4), where fractional precision affects the resolution of sampled audio and image data. Understanding binary fractions is essential for anyone working with graphics rendering, scientific computing, or financial calculations.
Related Terms / Search Tags: binary fraction, radix point, binary point, decimal point, fractional conversion, repeating binary fraction, successive multiplication method, mixed number conversion, floating-point rounding, 0.1 binary representation, IFT 510 Quiz 3, Purdue computer science