Significant digit computation time

In summary, performing simple arithmetic on numbers that extend 12 decimal places may result in a very small speed up in computation time when using floats instead of doubles. However, this depends on the machine and how it handles the calculation. Some machines may promote floats to doubles before doing the math, while others may use a combination of software and hardware to allow for a double add using a float as the basic data type. Therefore, the speed difference between using floats and doubles for these calculations is machine dependent.
  • #1
Tone L
73
7
If I am performing simple arithmetic on numbers that extend 12 decimal places i.g;
12.1234567891011 +11.1234567891011 and this calculation occurs 1000+ times, will calculation i.g;

12.123+11.123 speed up computation time if so how much and how do you arrive at this?
 
Computer science news on Phys.org
  • #2
With modern computers the speed up would be very small to near zero. In your first example, the numbers can be represented by a double and in the second by a float. With a float you manipulating fewer bytes of data and hence it will run faster but only slightly.

In this stackoverflow article it mentions that it's machine dependent as to which runs faster as some machines promote floats to doubles and then do the math as doubles whereas others use a combination of software and hardware to allow the machine to do a double add using a float as the basic data type.

http://stackoverflow.com/questions/4584637/double-or-float-which-is-faster
 
  • Like
Likes Tone L
  • #3
You have to consider that your computer may not know how to calculate in 32bit floats and may have to convert the float operands to double before calculation. The shorter numbers assuming they are float may calculate slower. If everything is double then there is no time difference on modern hardware.

BoB
 
  • Like
Likes jim mcnamara
  • #4
Command line user programs like awk (a UNIX tool) have done this type of implicit datatype conversion ("under the covers") for many years.
 

FAQ: Significant digit computation time

1. What is significant digit computation time?

Significant digit computation time refers to the amount of time it takes to calculate and determine the number of significant digits in a numerical value. Significant digits are the digits in a number that carry meaning and contribute to its overall precision.

2. How is significant digit computation time calculated?

The significant digit computation time depends on the complexity of the calculation being performed. It involves analyzing the mathematical operation, identifying the significant digits in the values being used, and then determining the correct number of significant digits in the final result.

3. What factors can affect significant digit computation time?

Some factors that can affect significant digit computation time include the complexity of the calculation, the precision of the input values, and the algorithm or method used to perform the calculation. Additionally, the processing speed and capabilities of the computer or device being used can also impact the time it takes to compute significant digits.

4. Why is significant digit computation time important?

Significant digit computation time is important because it affects the accuracy and precision of numerical calculations. A longer computation time may result in a more precise answer with a higher number of significant digits, while a shorter computation time may result in a less precise answer with fewer significant digits.

5. How can significant digit computation time be optimized?

To optimize significant digit computation time, it is important to use efficient algorithms and methods for performing calculations. Additionally, using input values with appropriate levels of precision can also help reduce computation time. Utilizing powerful computing systems and hardware can also improve the speed of significant digit computation.

Similar threads

Replies
1
Views
4K
Replies
11
Views
991
2
Replies
40
Views
687
Replies
8
Views
1K
Replies
6
Views
3K
Back
Top