Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
 static public float             RoundToBase(float a, int b)
 {
     return((float)Math2.RoundToBase((double)a, b));
 }
Ejemplo n.º 3
0
        //===============================================================================

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