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