public static Link FromNumber(long number) { if (number == 0) { return(Net.Zero); } if (number == 1) { return(Net.One); } var links = new Link[Bit.Count(number)]; if (number >= 0) { for (long key = 1, powerOf2 = 0, i = 0; key <= number; key *= 2, powerOf2++) { if ((number & key) == key) { links[i] = FromPowerOf2(powerOf2); i++; } } } else { throw new NotSupportedException("Negative numbers are not supported yet."); } var sum = Link.Create(Net.Sum, Net.Of, LinkConverter.FromList(links)); return(sum); }