public static Tryte operator *(Tryte t1, Tryte t2) { Tryte tryte = new Tryte(); int stop = t2.ToInt(); bool neg = false; if (stop < 0) { stop = -stop; neg = true; } for (int i = 0; i < stop; i++) { tryte += t1; } return(neg ? -tryte : tryte); }
public static Tryte operator %(Tryte t1, Tryte t2) { Tryte tmp = t1; if (t1 < 0) { while ((tmp += t2) <= t2) { ; } } else { while ((tmp -= t2) >= t2) { ; } } return(tmp); }
public static Tryte operator /(Tryte t1, Tryte t2) { Tryte tmp = t1, val = new Tryte(); if (t1 < 0) { while ((tmp += t2) <= 0) { val--; } } else { while ((tmp -= t2) >= 0) { val++; } } return(val); }
public bool Equals(Tryte other) { return(this.SequenceEqual(other)); }