I experience an error which I cannot manage to solve. It’s probably a stupid thing but
I could not find the problem. This is the thing.
Look at the following lines. The first MsgBox gives 0.4, which is the correct
result. The second MsgBox, which is just 1-previous_number gives 1 instead
of 0.6…It’s not a thing related to MsgBox as also the variable storing the result
gives 1…which is the problem?
Of course I know it…I mentioned “cast” in my OP to say that the result of the calculation seems a cast to integer (0.6 → 1) but I said it is not related to MsgBox as also the associated numerical variable “stores” that value.
As I could not figure out the issue I re-wrote the entire method from scratch using double as data type for all (which is also what Kem suggested). This solved the issue, but it is still a mystery to me…