Questions tagged [significant-digits]

Significant digits are a way of describing the precision of measurements in a scale-independent way.

Typically if a number is in normal scientific notation, the number of significant digits is the length (number of digits) of the mantissa or significand. The significant figures of a number are those digits that carry meaning contributing to its precision. This includes all digits except: All leading zeros, Trailing zeros when they are merely placeholders to indicate the scale of the number (exact rules are explained at Identifying significant figures), and spurious digits introduced, for example, by calculations carried out to greater precision than that of the original data, or measurements reported to a greater precision than the equipment supports.

Numbers are often rounded to avoid reporting insignificant figures. For instance, if a device measures to the nearest gram and gives a reading of 12.345 kg, it would create false precision to express this measurement as 12.34500 kg. Significant Figures - Wikipedia

178 questions
0
votes
0 answers

How do I duplicate in knitr the output from the R console?

If I write in the R console > 1.000000000000000123456 - 1 I get: [1] 2.220446e-16 If I type this in an .Rnw file, knitr gives the following output in the PDF: 1 - 1 with result 0 How do I get knitr to reproduce the console in a particular block…
mk9y
  • 320
  • 2
  • 11
0
votes
2 answers

I need to create a function in Groovy that has a single integer as a parameter and returns the number of significant figures it contains

Long story short, I'm working in a system that only works with groovy in its expression editor, and I need to create a function that returns the number of significant figures an integer has. I've found the following function in stack overflow for…
jrack11
  • 3
  • 2
0
votes
2 answers

How to format a number with locale and specified number of significant decimals in python

I have to export numbers as text using python and experience several ways of not doing what i want. There is string.format(), old % string format, and F-Strings - plenty of very smart ways of formatting things into strings, but I can't find a simple…
Thants
  • 1
  • 1
0
votes
1 answer

Significant figures for mean and sds in forest plot for metafor

I created a forest plot using metafor. The data I downloaded all has two significant figures after the decimal point for the study means and SDs, but when it uploads to the forest plot, these trailing zeros are dropped. How can I keep these trailing…
0
votes
0 answers

Resolution and Significant Figures handling

I am struggling to understand which is the correct way to display a measurement done by a certain sensor after some unit conversions. Imagine I have a sensor with resolution R = 0.1 that provides a measured value as a float, with arbitrary number of…
Miguel
  • 143
  • 1
  • 7
0
votes
1 answer

Remove Unwanted 0's from numeric element - R

New R-bie, I am trying to clean 3 columns of data from my dataframe df. The columns consist of numeric elements that range in their value from 0.19, 687.00, 49405, 107.440, 13764.000, 1.740. I will create df below for the purpose of this example.…
JJ Fantini
  • 213
  • 1
  • 11
0
votes
1 answer

Have three significant decimal digits even with 0 and no decimals in R

I would like to return all numbers with 3 significant digits after the decimal, even if the third digit is zero. For instance suppose I have x <- 0.8579 y <- 0.21 z <- 924894.2595 Then if I do x <- signif(x, digits=3) y <- signif(y, digits=3) z…
Lola1993
  • 151
  • 6
0
votes
1 answer

How to format axes ticks to significant digits in matplotlib

I am wondering if there is any way in matplotlib to control the axes ticks with significant digits, instead of controling by the number of decimals. For instance, the following numbers: 2, 15, 120 should be written as 2.00, 15.0, 120
Radvin
  • 143
  • 4
  • 10
0
votes
1 answer

How do set a range of cells to show the accuracy of the data automatically?

I was looking for a simple solution such as conditional formatting rules, but I can't find a way. I need a range of cells say a column of numbers to automatically adjust the accuracy (number of number after the decimal) based solely on the…
Tom Park
  • 13
  • 3
0
votes
1 answer

Number of decimals in a subplot in scientific notation pyplot

I am making a figure with subplots with different y-axes. The y-axis of the last plot needs to be represented in scientific notation, and I would like the numbers on the axis to only display 2 decimals, i.e., 2.15 instead 2.1565. I have been trying…
user3671704
  • 161
  • 7
0
votes
0 answers

How to round a number 3 significant figures in C++

My goal is very simple I just want to round a number by 3 significant figures for example if the user inputs: 655900 433.72 rounding it to 3 significant figures should look like : 656000 434
Andy
  • 3
  • 2
0
votes
2 answers

Rounding small fraction like 2.234556440301284e-100 to 2.23e-100 in python

I'm trying to print a very small p-value to a plot (p-value = 4.3289045262877305e-11). I need to round it to have fewer digits after the decimal so it will fit (4.33e-11) but when I'm using round(,3) it returns 0.0. How can I return the number like…
0
votes
1 answer

test-js: scientific software: significant figures

I am attempting to test scientific software written in TypeScript using Jest. I want to test all my floating point results to 8 significant figures, but it seems the only test method available in ts-jest, "toBeCloseTo", works on matching figures…
0
votes
1 answer

Undestanding p-value and '***'

I have a dilemma regarding significance in r. I don't really understand something. For example if I have: Does it show a significant relationship? Because the p-value seems to be greater than 0.05, but actually there are "***". Hope you can make me…
0
votes
1 answer

convert every element in bash array to x number of significant digits

I know you can alter the amount of floating points in a textfile of values with something along the lines of: awk '{printf("%.2g",$1)}' filename.txt which will reduce everything to two decimal digits. However, if I have a string in bash: echo…
WX_M
  • 458
  • 4
  • 20