Proportion calculator

Give three terms of a : b = c : x and get the fourth, with the cross-multiplication written out. It divides before it multiplies, which sounds like fussiness until you try 3 : 10308 = 2 : x and the usual order returns Infinity for an answer that fits comfortably in a double. Nothing you type here leaves your browser — it is worked out on your own device, so there is nothing to send and nothing to log.

The order you multiply in changes the answer

Cross-multiplying a : b = c : x gives a x = b c, so:

x = b × c ÷ a

Written exactly that way, a computer forms b × c first. If that product is past what a double can hold, the calculation is over before the division that would have brought it back into range:

3 : 10308 = 2 : x, as b × c ÷ aInfinity
… as b × (c ÷ a)6.666×10307

Same expression, same three numbers, one answer usable and one not. Dividing first keeps the intermediate value in range, costs nothing, and is not what anybody writes. This page does it, and checks the result against exact rational arithmetic rather than against another floating-point sum.

2 : 3 = 4 : x is 6 under either order. So is every example in every textbook, because they are all small tidy numbers chosen to make the method clear. The fault only appears at sizes nobody demonstrates with.

What a proportion actually claims

A proportion says two ratios are the same ratio, not that the numbers are related in any other way. If three machines fill 120 crates, six machines fill 240 — that is a proportion, and it assumes the second three machines work exactly like the first three. Most real quantities stop being proportional somewhere, and the arithmetic cannot tell you where.

The first term cannot be zero. Nothing is in proportion to nothing, so there is no x that makes 0 : b the same ratio as c : x. This page says that rather than returning Infinity or NaN.

Where to go next