08-20-2025, 09:14 PM
(08-20-2025, 08:27 PM)Dimster Wrote: My code is extremely long and convoluted, so I'm just wondering if anyone has any ideas of where I should look to solve a simple addition problem.bPlus's suggestion is what I would have said too. But he didn't provide an explanation. Floating Point Math on machines has a precision limit. Your result is currently chopped because your exceeding that precision limit for a TYPE SINGLE (The Default type).
Here is the jest of the math and values which are not adding up correctly
Code: (Select All)Mean = .3061225
MF = .0000001
CycleValue = Mean + MF
Print CycleValue
So the above code works fine, CycleValue will equal .3061226 but that same addition in my program comes up with CycleValue = .3061225. I'm at a loss to understand why this addition of .0000001 will not take, and not sure where to look in my program that might be the culprit which prevents this simple addition. The value of Mean is dynamic in that there are multiple Cycles but that Mean Factor (MF) stays a constant .0000001.
Any ideas as to what's going on?
DIM Mean as double
DIM MF as double
DIM CycleValue as DOUBLE
Do this first. If that doesn't work then try _FLOAT instead of double. That has even more precision and range.

