Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 protected bool Equals(GNumber other)
 {
     return(Last == other.Last && Equals(Nodes, other.Nodes));
 }
Ejemplo n.º 3
0
 static void Main(string[] args)
 {
     var gn = GNumber.Create(80, 3);
 }