public bool Same(NiftyInteger comparee) { if (value == comparee.value) return true; else return false; }
public static void Main() { NiftyInteger myNifty = new NiftyInteger(10); NiftyInteger yourNifty = new NiftyInteger(); Console.WriteLine("I made these: " + myNifty.GetValue() + " " + yourNifty.GetValue() + "\n"); if (myNifty.Same(yourNifty)) { Console.WriteLine("FAIL\n"); } else { Console.WriteLine("Same() works.\n"); } NiftyInteger ourNifty = myNifty.Multiply(yourNifty); Console.WriteLine("Is this zero?: " + ourNifty.GetValue()); }
public NiftyInteger Multiply(NiftyInteger multiplicand) { NiftyInteger product = new NiftyInteger(value * multiplicand.value); return product; }
public NiftyInteger(NiftyInteger aNiftyInteger) { value = aNiftyInteger.value; }