That one works, but I wonder if relying on the compiler to produce the value of some other calculated number to use as a constant could cause an inconsistency if one program was compiled on a 32-bit and another on a 64-bit system?
Pete
No more so than if you calculated the value using a variable to store the results.
32-bit programs might give you an answer of 0.11111111111111117896 due to their 80-bit FPU math processors, while the 64-bit versions would give the result as 0.11111111111111121345, or some such, due to using 64-bit math processors. Whether you store that result in a CONST, or a variable, it's not going to change the fact that the OS is going to produce that same mathematical answer each time it's ran.
Now, where it might generate errors for you, is if you start substituting values between CONST and literal results yourself.
Let's say for example that you have a formula that produces the results above. CONST x = foo / whatever. Now, you compile on a 32-bit OS and print out the results to see they're 0.11111111111111117896.
Somewhere in your code you have a line like: IF program_calculation = 0.11111111111111117896 * 2 THEN...
Now, on the 32-bit OS, x and 0.11111111111111117896 are going to be equal. On a 64-bit OS, those values might be minutely different. Your 32-bit compiled EXE may not run exactly the same on the 64-bit EXE, as the values won't match -- which makes it advisable to use CONST over literals in such cases, or to at least not mix-and-match them any more than possible.
(Note, the reverse situation is impossible -- the you CAN'T run a 64-bit EXE on a 32-bit OS.)