示例#1
0
        public static GNumber Create(long number, long b)
        {
            var result = new GNumber();

            result.val  = number;
            result.Last = number % b;
            number     /= b;

            long power = 0;

            while (number > 0)
            {
                var rest = number % b;
                number /= b;
                power++;
                if (rest > 0)
                {
                    var p = GNumber.Create(power, b);
                    result.Nodes[p] = rest;
                }
            }
            return(result);
        }
示例#2
0
 protected bool Equals(GNumber other)
 {
     return(Last == other.Last && Equals(Nodes, other.Nodes));
 }
示例#3
0
 static void Main(string[] args)
 {
     var gn = GNumber.Create(80, 3);
 }