meta data for this page
  •  

F_ITERATECROSSSUM

function from adhoc

Entrypoint iteratecrosssum compatible with UTF-8


Inputs/Outputs

   Input      INTEGER     natural number
   Output     INTEGER     iterate (or single-digit) cross sum from input

Syntax

   Iterate cross sum is to build the cross sum of a number as long as the result is a single digit.
   i.e. 12345: 5+4+3+2+1 = 15 -> 5+1 = 6
   Test-SQL
   SELECT 6 AS ISCORRECT, F_ITERATECROSSSUM(12345) FROM RDB$DATABASE;
   SELECT NULL AS ISCORRECT, F_ITERATECROSSSUM(NULL) FROM RDB$DATABASE;