Subtraction between two fields of the same value does not give zero-SQL Server

Asked

Viewed 100 times

0

Someone could explain to me: I made a Join between two tables. Both bring the same value in their fields. And when subtracting one value minus the other, it does not give zero. As this is possible?

E1_SALDO  = 990,42

BAIXZ0    = 990,42

SUBTRACAO = 990,42 - 990,42 = 1,13686837721616E-13
  • What kind of field?

  • Both are numerical.

  • Catharina, probably some column is declared as floating point (real or float). Or both.

1 answer

1

  • I don’t think I understand your explanation. In the example I put 990.42. But the calculation is done with values that are in the bank. The subtraction between values occurs for all titles and for the first time, the subtraction of two equal values was not zero. I shouldn’t have to do this conversion for every calculation I do in the bank. I never did it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.