Subject Firebird 3: formal declaration of ABS internal function, is it polymorphic?
For DB upgrade (from 1.5 to 3.0) I need to define custom internal function like this:

create or alter function F_ABS (
    VAR_1 double precision)
returns integer
declare variable result double precision;


  result = abs(var_1);
  return result;


But I am confused. My experiments assert that ASB internal function is polymorphic - it returns BIGINT for BIGINT argument and DOUBLE PRECISION for DOUBLE PRECISION arguments, it can be tricky to determine the return type if string arguments is given (and implicit conversion occurs).

I would like that F_ABS has this polymorphic nature of ABS. How should I declare F_ABS to have this polymorphic nature?