Example #1
0
        static public bool              IsPowerOfBase(int number, int b)
        {
            // ensure the base is valid
            if (!(b >= 2))
            {
                throw new ArgumentOutOfRangeException("b", b,
                                                      "digitBase must be greater or equal to 2.");
            }

            return((double)number == Math2.RoundToBase((double)number, b));
        }
Example #2
0
 static public float             RoundToBase(float a, int b)
 {
     return((float)Math2.RoundToBase((double)a, b));
 }
Example #3
0
        //===============================================================================

        static public int               RoundToBase(int a, int b)
        {
            return((int)Math2.RoundToBase((double)a, b));
        }