XXIIVV

A fraction represents a part of a whole.

A fraction consists of a numerator displayed above a line, and a denominator below.

NumberPrimes
235
2/3110
27/25032
100/9222

Multiplying a number by a fraction, is the same as adding the prime numerators and subtracting the prime denominators. For example, multiplying 18, which is made of 2^1 x 3^2, by 2/3 means incrementing prime 2, and decrementing the prime 3, or 2^2 x 3^1.

To experiment with primes, have a look at Fractran.

Reducing

Dividing the numerator and denominator of a fraction by the same non-zero number yields an equivalent fraction: if the numerator and the denominator of a fraction are both divisible by a number (called a factor) greater than 1, then the fraction can be reduced to an equivalent fraction with a smaller numerator and a smaller denominator.

Subtraction Method

function gcd(a, b)
	if b = 0
		return a
	else
		return gcd(b, a mod b)

Recursive Method

function gcd(a, b)
	if b = 0
		return a
	else
		return gcd(b, a mod b)

Comparing

Comparing fractions with the same positive denominator yields the same result as comparing the numerators.

Addition/Subtraction

To add fractions containing unlike quantities , it is necessary to convert all amounts to like quantities.

1/4 + 1/3
1*3/4*3 + 1*4/3*4
3/12 + 4/12 = 7/12

The process for subtracting fractions is, in essence, the same as that of adding them: find a common denominator, and change each fraction to an equivalent fraction with the chosen common denominator.

Multiplication

To multiply fractions, multiply the numerators and multiply the denominators.

2/3 * 3/4 = 6/12