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