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

  • Thread starter Thread starter kubota
  • Start date Start date
  • Tags Tags
    Constants Machine
AI Thread Summary
The discussion centers on the values of "machine constants" relevant to the TOMS Algorithm 691 in the context of Excel/VBA. Two key constants are highlighted: the smallest relative spacing, represented as "B ** (-T)" (where B is the base, typically 10, and T is the number of digits), and the largest relative spacing, expressed as "B**(1-T)". The smallest relative spacing is suggested to be approximately 4.996E-15, aligning with the concept of EPSILON from the C Standard Library, which defines the smallest number that, when added to 1.0, results in a distinguishable value. However, there is uncertainty regarding the value for the largest relative spacing, with no clear examples provided in the discussion. Participants seek clarification on these constants and their specific values within the Excel/VBA environment for effective error management in programming.
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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top