Closed nja closed 5 years ago
That is working as defined, if you convert from your attribute value implicitly to a number through the addition operator the type xs:double
is used and it has such inaccuracies, like other programming languages as Javascript with its Number type or C# with its double type also have.
With XPath 2.0 for exact computations use xs:decimal
s explicitly: xs:decimal(/total/@taxableAmount) + xs:decimal(/total/@taxAmount) = xs:decimal(/total/@netAmountIncTax)
.
It because of double conversion.
The result from second test is 1715.5500000000002
.
You're right of course. I tried the plain equality in C# before submitting, but the details about how literals are evaluated bit me...