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
3
votes
2 answers

Which way has better accuracy to compute the matrix matrix vector product, A B u?

I want to compute the vector, s = A B u, where s and u are N-dimensional complex vector, A is a N-by-M complex matrix, B is M-by-N complex matrix. Which of the following two ways has better accuracy (more significant digits) when the elements of A,…
3
votes
2 answers

How to generate a summary statistics table with all relevant decimal places to appear in the resulting table in R?

I have an exceptionally large dataset (50+ Sites, 100+ Solutes) and I would like to quickly generate a summary table of descriptive statistics for the data and be able export it as a .csv file. Sample code (a very small subset of my data): Site <-…
3
votes
0 answers

Controlling digits after decimal point in R summary

Let the data.frame object x below x <- data.frame(y = seq(0, 1, by = .1), z = letters[1:11]) which can be summarized as follows: > summary(x) …
Waldir Leoncio
  • 10,853
  • 19
  • 77
  • 107
3
votes
1 answer

Extracting floating-point significand and exponent in NumPy

I would like to be able to extract the significand and exponent of floating-point numbers in NumPy. Getting the exponent as an integer is fine and ok for the significand. Getting the significand as a bitfield would be even more convienient. I am…
equaeghe
  • 1,644
  • 18
  • 37
3
votes
1 answer

Round to significant digits *only* with decimal portion of number in R

The signif() function rounds values based on the specificed number of significant digits in a given value. The function applies to all the digits in the number, though, so numbers of different orders of magnitude are rounded and truncated…
Andrew
  • 36,541
  • 13
  • 67
  • 93
3
votes
1 answer

Finding the first significant figure of difference between two very similar values

I'm trying to reproduce the computations that led to a data set data.ref. I'd like to test how well my current implementation does by comparing the reference data to my computed results, data.my. Since each column of the data should have comparable…
Empiromancer
  • 3,778
  • 1
  • 22
  • 53
3
votes
1 answer

Stars significance level in r

Hi This ist the definiftion of the significance test in r. If you do a linear regression in r this is what r retuns. Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1 My question is for *** what is the significance level?It cannot be…
vomicha
  • 65
  • 1
  • 5
3
votes
1 answer

Increase significant digits in pyplot cursor

I have a function plotted using pyplot. When I move the cursor over the window, I can see the values for X and Y of the location of the cursor at the bottom-left of the window (display as, for example, x = 4.27567e+06 y = 6.98764e-09). How can I…
diemilio
  • 53
  • 9
3
votes
3 answers

Trailing zeros after sequential rounding with round() followed by signif()

I am trying to apply a sequential rounding function on any real number so that the following condition is met: "Numbers should be reported with no more than two decimal digits and no more than two significant figures". For example: 0.0236 should be…
3
votes
1 answer

Different significance of parameter estimation in GARCH models using R (rugarch & fGarch package)

I have been working with the two packages fGarch and rugarch to fit a GARCH(1,1) model to my exchange rate time series consisting of 3980 daily log-returns. fx_rates <- data.frame(read.csv("WMCOFixingsTimeSeries.csv", header=T, sep=";",…
philippe
  • 47
  • 7
3
votes
2 answers

How many significant digits should I use for double literals in Java?

How many significant digits should I use when defining a double literal in Java? This is assuming that I am trying to represent a number with more significant figures than a double can hold. In Math.java I see 20 and 21: public static final double E…
sourcenouveau
  • 29,356
  • 35
  • 146
  • 243
3
votes
4 answers

Set Least Significant Bit in C

I write a simple steganography tool in C with bmp images. I read the image to memory and the text to hide in char bytes[8] one character at a time. so eg. a=0d97 bytes[0] = 0 bytes[1] = 1 bytes[2] = 1 bytes[3] = 0 bytes[4] = 0 bytes[5] = 0 bytes[6]…
2
votes
3 answers

Significant digits increasing

Let's, float dt; I read dt from a text file as inputFile >> dt; Then I have a for loop as, for (float time=dt; time<=maxTime; time+=dt) { // some stuff } When dt=0.05 and I output std::cout << time << std::endl; I…
Shibli
  • 5,879
  • 13
  • 62
  • 126
2
votes
1 answer

How can I find the minimum significant step of a float value given it's amount of significant figures?

Let's say I have a set of float numbers, each with an int value of Significant Figures. What is the simplest and fastest C# method to find the minimum significant step (as a power of 10) for each value? Value Significant Figures Expected…
Miguel
  • 143
  • 1
  • 7
2
votes
1 answer

Controlling the number of significant digits used by jsonencode

I'd like to use jsonencode in Matlab R2022a to encode a structure containing double precision values, like e.g.: >> s = struct('a', sqrt(2)) s = struct with fields: a: 1.4142 >> jsonencode(s) ans = '{"a":1.4142135623730951}' But I don't…
Ratbert
  • 5,463
  • 2
  • 18
  • 37