45.678 to 3 figures
- Input
- 45.678
- Expected output
- 45.7
The first 3 digits are 4, 5, 6; the next one, 7, rounds the 6 up.
round to significant figures
Rounding to N significant figures means locating the Nth significant digit and checking only the next one: if it is 5 or higher, the Nth digit goes up by one; otherwise it stays. The rule changes, though, depending on the operation: multiplication and division use the figure count, addition and subtraction use the decimal place.
The first 3 digits are 4, 5, 6; the next one, 7, rounds the 6 up.
Rounding the 9 up overflows to 10 and carries over, resulting in 0.030, not 0.029.
In double-precision floating point, 2.675 is stored as 2.67499999999999982236, smaller than 2.675, so the correct rounding is down.
Significant figures are the digits that carry meaning regarding the precision of a measurement. They include all non-zero digits, sandwiched zeros, trailing zeros after a decimal point and, in some cases, leading zeros after the decimal. The more significant figures, the more precise the recorded measurement.
The standard convention rounds up. An alternative used in science and finance, "banker's rounding," rounds to the nearest even digit instead of always up: 0.125 to 2 figures becomes 0.13 under the standard rule, but 0.12 under the even-digit rule, since 2 is already even.
No. Multiplication and division round to the smallest significant-figure count among the factors: 4.5×2.331≈10.5 becomes 10 (2 figures). Addition and subtraction round to the least precise decimal place, not to a figure count: 12.11+0.3=12.41 becomes 12.4, at the tenths place.
Because double-precision floating-point representation stores 2.675 as a slightly smaller value, 2.67499999999999982236, so it is genuinely below the halfway point and rounding down is correct; it is not a calculator flaw, it is how the number is stored internally.
All calculations stay in your browser. No data is sent to any server.