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

Compare BigDecimals as acceptably close based on their significant digits

I have two BigDecimals and I'd like to determine if they are close based on their significant digits. For example, consider the following: BigDecimal million = new BigDecimal(1_000_000); BigDecimal tenmillion = new…
dimo414
  • 47,227
  • 18
  • 148
  • 244
0
votes
3 answers

Counting Significant Figures java

I am trying to make a program that counts significant figures and I am almost done there is one last thing that I am completely stuck on I can't figure out how to count the zeros between the non zero numbers here is my code: public class Main { …
user3097544
  • 101
  • 2
  • 3
  • 14
0
votes
1 answer

How to shift left the least significant zero?

What is the fastest way to perform the following bit-wise transformation? X..XA01..1 // input X..X011..1 // output Thus the least significant zero bit has to be set to one, and the bit left to it (regardless it is zero or one) has to be set to…
0
votes
0 answers

python significant figures and float

I'm do not understand why 1.1 + 2.2 is not 3.3 if a computer calculates this. I am trying to understand the working of binairy floating points.. but I am not even sure of that float the cause is. could you explain this to me?, I have not been able…
r44
  • 36
  • 4
0
votes
2 answers

What is a more elegant way of showing N significant digits of a calculation?

I created the following function to show the last six significant digits of a number: private static string ShowSigDigits(long n, int sig) { string[] arr1 = n.ToString().Select(c => c.ToString()).ToArray(); // reverse the array of string…
ElHaix
  • 12,846
  • 27
  • 115
  • 203
0
votes
2 answers

jQuery Countdown compact with two significant digits

When I display the compact countdown with two significant digits it shows something like: "2d 12:00:00" and minutes/seconds stay at "00" forever. How can I get it to display something like: "2d 12h" instead? Strangely enough if I use the non-compact…
user1583209
  • 1,637
  • 3
  • 24
  • 42
0
votes
2 answers

Java - how to round a calculation statement result to two significant figures

New to Java, relatively new to programming. The code below is the last couple lines of a program that already runs perfectly -- I just want to round the end result (the newTuition variable) and limit it to two significant figures. newTuition,…
0
votes
1 answer

How can i get up to 7 significant figures of my result in FORTRAN90?

INTEGER, PARAMETER :: SINGLE=SELECTED_REAL_KIND(7) REAL(KIND=SINGLE) :: K REAL::X ... K=X WRITE(*,*) K When i write 5 or 6 inside SELECTED_REAL_KIND, it outputs six significant figures but when i try 7, it outputs more than 7. Can you tell me why?…
-2
votes
1 answer

EXCEL formula for significant digits

I am searching for an Excel formula to get the amount of significant figures from a decimal number or integer (I realized that cell needs to be string to have trailing zeros) For example: from an integer I can do: =len("113") which has 3 sig.…
cekar
  • 358
  • 2
  • 12
-2
votes
2 answers

Significance in ostream or fprintf in C++

I'm trying to get an output to file such as this: 1.11111 11.1111 111.111 1111.11 111111 In other words, I try to set the significance of my output, instead of my precision. I've tried oFile <
BdB
  • 471
  • 5
  • 18
-2
votes
2 answers

Print an array of numbers from the least significant digit to most significant digit?

8 | * 7 | * 6 | * 5 | * 4 | * * 3 |* * * * * * 2 |* * * * *** ** * * 1 |* * *** ****** **** * * +--------------------------- 012345678901234567890123456 11111111112222222 how would you print numbers from the least significant digits…
user133466
  • 3,391
  • 18
  • 63
  • 92
-2
votes
2 answers

Solution within 8 significant figures of the exact solution

I am writing a program in python and I want my solutions to return within 8 significant figures of the exact solution. I have searched the forums here, however there doe not seem to be any direct answer. I want a simple solution to make sure that…
-3
votes
2 answers

Values in R legends are shortened to Ne+n form

We are trying to print some Finnish forestry maps using R. The map is drawn nicely but some of numbers in the legends are not shown in their full length, but in the format 3e+06. This seem to happen when the size of a row in the legend is too long.…
Lohku
  • 1
1 2 3
11
12