public static MInteger Add(MInteger firstInteger, MInteger secondInteger) { MInteger result = new MInteger(firstInteger); MInteger counter = new MInteger(); while (!counter.Equals(secondInteger)) { result.Next(); counter.Next(); } return(result); }
public byte GetByte(MInteger index) { if (IsNull()) { return(0); } MCircularListNode <bool> node = list.firstNode; MInteger counter = new MInteger(); bool iterate = true; while (iterate) { if (counter.Equals(index)) { iterate = false; } else { if (object.ReferenceEquals(node, list.lastNode)) { return(0); } node = node.nextNode; } } MInteger limit = new MInteger("8"); counter = new MInteger(); byte result = 0; byte adder = 1; while (true) { if (counter.Equals(index)) { return(result); } if (object.ReferenceEquals(node, list.lastNode)) { return(result); } if (node.nodeValue) { result += adder; } adder *= 2; node = node.nextNode; } }