What are the Values of Machine Constants in Excel/VBA?

  • Thread starter Thread starter kubota
  • Start date Start date
  • Tags Tags
    Constants Machine
Click For Summary
SUMMARY

The discussion focuses on the values of machine constants in Excel/VBA, specifically the smallest and largest relative spacings as defined in the Fortran code for TOMS Algorithm 691. The smallest relative spacing is calculated as 10-15, while the largest relative spacing is derived as 10-14. Users are seeking clarification on these constants and their specific values within the Excel/VBA environment, with a reference to the C Standard Library for further details.

PREREQUISITES
  • Understanding of machine constants in programming
  • Familiarity with Excel/VBA programming
  • Knowledge of Fortran algorithms, specifically TOMS Algorithm 691
  • Basic understanding of the C Standard Library and its functions
NEXT STEPS
  • Research the definition and application of machine constants in programming environments
  • Explore the C Standard Library, particularly the header for floating-point constants
  • Investigate error management techniques in numerical computing
  • Learn about the implications of floating-point precision in Excel calculations
USEFUL FOR

This discussion is beneficial for software developers, data analysts, and anyone involved in numerical computing or programming in Excel/VBA who seeks to understand machine constants and their impact on precision and error management.

kubota
Messages
4
Reaction score
0
What are the Values of "Machine Constants" in Excel/VBA?

The Fortran code for TOMS Algorithm 691 refers to five "machine constants" belonging to the host computing environment. Two of these are:

1. "The smallest relative spacing", given as "B ** (-T)", where B = base (say 10?), and T = number of base-B digits, say 15, so this = 10**-15...?
2. "The largest relative spacing", given as "B**(1-T)", so this = 10**(1-15) = 10**-14...?

It appears the values are being used in the program for fine-grain error management. Unfortunately, I can find no general references to these constants, and I'm not certain what they mean, nor what their values are...

Would anyone be able to enlighten me on the particular values of these two parameters for the Excel/VBA environment.

TIA for any assistance.
 
Technology news on Phys.org


See http://www.netlib.org/blas/d1mach.f

At the bottom of the code these constants are defined in terms of standard C library functions, so you can get more details from the C standard if you need that.
 


Thanks for your reply.

I found one glimmer of hope in a statement in a (web) file named C Standard Library <float.h>:

... EPSILON: smallest number x such that 1.0 + x != 1.0

Using Excel, I obtained a figure of around 4.996E-15, which may well be the value for my point 1 above, ie, the smallest relative spacing. Am I on the right track here?

Unfortunately, I can find no similar example or statement defining my point 2 above.

Any help appreciated.
 

Similar threads

  • · Replies 18 ·
Replies
18
Views
6K
  • · Replies 17 ·
Replies
17
Views
2K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
29
Views
6K
  • · Replies 29 ·
Replies
29
Views
4K
Replies
8
Views
3K
Replies
3
Views
992
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K