# Why this very simple problem turns to "Indeterminate"?

Why the following calculation gives Indeterminate value?

a = 4.248354255291589*^-18;
b = -4.248354255291589*^-18;
c = 1.3956025592769147*^18;
X = a + c
Y = b + c
Z = X - Y
Z Log[Z]

(*1.3956*10^18
1.3956*10^18
0.
Indeterminate*)


I know that 0*Logis Indeterminate value, but the question is why X is equal to Y even though "a" is not equal to "b"?

You have X=Y=c because a and b are 10^36 smaller than c and the machine precision is 10^-15.

Here you are working in machine precision (a machine precision number has nothing after the )

It is possible to work with a higher precision, for example 40 digits:

a= 4.24835425529158940*^-18
b = -4.24835425529158940*^-18
c = 1.395602559276914740*^18
X = a + c
Y = b + c
Z = X - Y
Z Log[Z]t


4.248354255291589000000000000000000000000*10^-18
-4.248354255291589000000000000000000000000*10^-18
1.395602559276914700000000000000000000000*10^18
1.395602559276914700000000000000000004248*10^18
1.395602559276914699999999999999999995752*10^18
8.497*10^-18
-3.340*10^-16

EDIT

It is possible to mix different precisions, for example 4 digits for a and b and 40 for c :

a = 4.2483542552915894*^-18
b = -4.2483542552915894*^-18
c = 1.395602559276914740*^18
X = a + c
Y = b + c
Z = X - Y
Z Log[Z]


4.248*10^-18
-4.248*10^-18
1.395602559276914700000000000000000000000*10^18
1.395602559276914700000000000000000004248*10^18
1.395602559276914699999999999999999995752*10^18
8.50*10^-18
-3.340*10^-16

But, as soon as there is a machine precision number somewhere , the whole calculus is done in machine precision. So this doesn't work :

a = 4.248354255291589*^-18
b = -4.2483542552915894*^-18
c = 1.395602559276914740*^18
X = a + c
Y = b + c
Z = X - Y
Z Log[Z]
`

4.24835*10^-18
-4.248354255291589000000000000000000000000*10^-18
1.395602559276914700000000000000000000000*10^18
1.3956*10^18
1.395602559276914699999999999999999995752*10^18
0.
Indeterminate