Hi. I'm trying to compute an IBAN number given an internal account number and the branch's sort code. This involves operations on large integer values.
However, internal implementation still seems to be based on double precision floating point numbers, along with their limitations.
Bug demonstrated by the following example:
select
cast('100000000000000000000000' as decimal(38,0))
, cast('100000000000000000000001' as decimal(38,0))
The results are 99999999999999992000000 and 100000000000000010000000, respectively, which reveals the effect of the underlying machine epsilon.
Is there no way to perform computations on big decimals while retaining precision?