ApproximateFraction.Program.NumberLength C# (CSharp) Method

NumberLength() private static method

private static NumberLength ( int x ) : int
x int
return int
        private static int NumberLength(int x)
        {
            int n = 0;
            while (x > 0)
            {
                n++;
                x /= 10;
            }
            return n == 0 ? 1 : n;
        }
    }