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
2
votes
1 answer

How to specify decimal places not significant digits in xtable output

I'm using the R xtable package to print out my dataframes as LaTeX tables. I have been using the digits option to specify the number of significant digits for the values in my tables. However, with digits=3, I get outputs like: ... chat & chatd &…
robintw
  • 27,571
  • 51
  • 138
  • 205
2
votes
1 answer

more significant digits

How can I get more significant digits in R? Specifically, I have the following example: > dpois(50, lambda= 5) [1] 1.967673e-32 However when I get the p-value: > 1-ppois(50, lambda= 5) [1] 0 Obviously, the p-value is not 0. In fact it should…
user1357015
  • 11,168
  • 22
  • 66
  • 111
2
votes
2 answers

Python Math significance level

I have from a dataset I load in 2 values. x1=5.904e-16 and x1=1.048576e-14 granted these are tiny numbers, but all I want to do is average them. avg = 1/2*(x1+x2) but this gives avg = 0 Arr!
StudentOfScience
  • 809
  • 3
  • 11
  • 35
2
votes
3 answers

How to convert float to string in Delphi specifying Significant Digits, not Decimal Digits (and not G format)

I usually print numbers with a specific number of decimal digits, but I now need to print one with a specified number of significant digits. The numbers need to be like "1.23" not like "1.2 E0". I see that Delphi will do the latter with the G…
jon bondy
  • 411
  • 3
  • 11
1
vote
1 answer

Significant digits without ROUND

I need to show two significant digits, but it is important that the original data does not get lost. Currently I have a macro that uses ROUND, however this changes the actual number instead of changing only the decimal places. cell.Value =…
user17269242
  • 129
  • 8
1
vote
2 answers

Rounding a number based on the amount of decimals in another column in R

My goal is to calculate the standard deviation and the mean of a column in a data frame. After this calculation, I want to round the standard deviation to the first significant decimal and round the mean values to the same amount of decimals as the…
Bacillus
  • 47
  • 6
1
vote
0 answers

Compact letter display after Kruskal-Wallis-Test

I'm trying to evaluate some data for my thesis. I can use R to build a boxplot and conduct the statistical test just fine, and I can do the compact letter display manually... but this time I simply have too much data to do it this way. I'm plotting…
Liz
  • 11
  • 1
1
vote
3 answers

How to plot the string with power of ten as the exponential?

I want to plot a scientific title or legend label which is e^(x*10**b). Here's an example: import matplotlib.pyplot as plt data = 5.55e10 plt.title('e$^{%.2e}$'%(data)) And, the actual output is: The preferred output is:
zxdawn
  • 825
  • 1
  • 9
  • 19
1
vote
2 answers

signif doesn't give me the correct number of significant digits in R

I want to round my data with significant digits. Therefore I am using signif to achieve that. For example: signif(0.0054324, digits=2) [1] 0.0054 However, I realised that there are some cases where signif doesn't work as I expected. signif(1003.04,…
emr2
  • 1,436
  • 7
  • 23
1
vote
1 answer

Display trailing zeros with signif

I am creating tables displaying numerical data with the gt package in R. I need to display 2 significant figures in my table and want to show trailing zeros if relevant (for aesthetic purposes). For example, I need the number 0.301 to display as…
Nicki_NZ
  • 123
  • 8
1
vote
2 answers

How do I output a result to the number of decimal-points user previously entered (C)?

I'm trying to output my results to the decimal accuracy the user has input. In other words, if they enter 145, then it outputs to 0 d.p. - if they enter 145.67, it outputs the result to 2 d.p. I've tried achieving this by trying different things…
1
vote
1 answer

How can I keep the trailing zereos with .3g?

I have the following value: 6.095651174e-09 and I am printing it like this: print(f' the result is: {forces[index]: .3g} N') Here the output is 6.1e-09 but I want to keep the zero after it was rounded from 6.09 to 6.1. My desired output would be:…
Ted T
  • 13
  • 4
1
vote
1 answer

How do I display 3 significant digits for p values in logistic regression table using add_global_p (car, gtsummary)

Where/how do I insert style_p_value argument to display 3 significant digits for the p values in this table? if (requireNamespace("car")) { tbl_uv_global_ex2 <- trial[c("response", "trt", "age", "grade")] %>% tbl_uvregression( method…
1
vote
1 answer

R the number of significant digits leads to unexpected results of inequality using eval and parse text

I am working on boolean rules related to terminal node assignment for CART-like trees related to my work (http://web.ccs.miami.edu/~hishwaran/ishwaran.html) I have noticed problematic behavior in evaluating inequalities of character strings using…
1
vote
1 answer

Calculation with approximate digits in Wolfram Mathematica

I have a problem calculating with significant figures in Wolfram Mathematica. Let me explain better. I have f[a_, b_] = a b Sin[25] and f[92.0 , 9.81] =381.421 However, I would first like to approximate the result of the product between a and b to…
Elzevirs
  • 13
  • 2