0

I want to "concatenate" numbers to create temporary ids for tuples of objects, but I am worrying about precission loss and rounding errors. Query below suggests that there are no problems with rounding at least up to 10^27.

select t.remvalue, t.logvalue, t.totvalue, (t.totvalue - 1000000000*1000000000 ) as diffvalue18, (t.totvalue - 1000000000*1000000000*1000000000 ) as diffvalue27  from (
select 1 as remvalue, 9 as logvalue, 1000000000 + 1 as totvalue from dual union all 
select 2 as remvalue, 18, 1000000000*1000000000 + 2 from dual union all 
select 3 as remvalue, 18, 1000000000*1000000000 + 3 from dual union all 
select 4 as remvalue, 27, 1000000000*1000000000*1000000000 + 4 from dual 
 ) t
--  Rem log  total   difff18       diff27
--4 4   27  1E27    9.99999999E26   4      --diff 27 is correct

How far can I actually go with such "concatenation of integers without running into a problem?

Stepan
  • 213
  • 3
  • 13

1 Answers1

0

Since ypercube suggested that the max_value << 10^100 I did a binary search.
Oracle supports 39 digit precision for whole numbers.

Stepan
  • 213
  • 3
  • 13