It means (if i understand right) that if i do this:

my_array[2] = 3000.0003;

The internal value of my_array[2] is 3000.00024414 ?

And that is why (3000.0003 (real 3000.00024414) - my_array[2] (real 3000.00024414)) == 0 ?

That helped me a bit:
https://www.youtube.com/watch?v=PZRI1IfStY0
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html

I think I got it (in parts), I have to admit that I have some knowledge gaps in this area. I keep reading about it, and while I'm doing this i can see why i never had problems with it. I always set a precision (like in R options(digits = 12)) and round to the accuracy i need, and i normally never do this if (double == double) without rounding.

Code
> R-CODE
options(digits = 12)
> a<-3000.0003
> a
[1] 3000.0003
> options(digits = 15)
> a<-3000.0003
> a
[1] 3000.0003
> options(digits = 16)
> a<-3000.0003
> a
[1] 3000.0003
> options(digits = 17)
> a<-3000.0003
> a
[1] 3000.0003000000002
> options(digits = 18)
> a<-3000.0003
> a
[1] 3000.00030000000015
> options(digits = 20)
> a<-3000.0003
> a
[1] 3000.0003000000001521

Why is R not adding anything until digits >= 17? Or better: Why is the value in C-Lite 3000.00024414 and in R 3000.0003>>00000000<< up to digits = 16?

How can i influence this in C-lite? Because at this point rounding(3000.00024414, to 4 digits) will result in 3000.0002, not 3000.0003 - and in R that works fine?

Many thanks for helping me with that basic stuff!

Last edited by laz; 08/21/19 01:02.