Significant figures calculator
Rounding here is done on the exact value, so a number that sits precisely on a half rounds the way the rule says rather than the way binary floating point happens to store it.
Rounded to significant figures
3.142
- Rounded to decimal places
- 3.142
- Error from rounding to sig figs
- 0.000 407 346 41
- Error from rounding to decimal places
- 0.000 407 346 41
Show the working
- Number = 3.141 59
- Significant figures = 4
- Decimal places = 3
- magnitude = 3.141 59 != 0 ? floor(log10(abs(3.141 59))) : 0 = 0
- scale = 10^(4 - 1 - 0) = 1000
- Rounded to significant figures = round(3.141 59 * 1000) / 1000 = 3.142
- Rounded to decimal places = round(3.141 59, 3) = 3.142
- Error from rounding to sig figs = 3.142 - 3.141 59 = 0.000 407 346
- Error from rounding to decimal places = 3.142 - 3.141 59 = 0.000 407 346
Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.
Scenarios & local history
Compare a saved scenario
Recent calculations
The formula
- Rounding to n significant figures: scale by 10^(n-1-floor(log10|x|)), round, scale back.
- Halves round away from zero.