public static BigDecimal gcdForBigDecimals(BigDecimal a, BigDecimal b) {
        int scaleA = a.scale();
        int scaleB = b.scale();

        BigDecimal scaledA = a.movePointRight(Math.max(scaleA, scaleB));
        BigDecimal scaledB = b.movePointRight(Math.max(scaleA, scaleB));

        BigDecimal gcdValue = gcd(scaledA, scaledB);

        return gcdValue.movePointLeft(Math.max(scaleA, scaleB));
    }
Support floating-point and integer gcd

@param a first number
@param b second number
@return The greatest common divisor of a and b
inlong-sdk/transform-sdk/src/main/java/org/apache/inlong/sdk/transform/process/function/arithmetic/GcdFunction.java