Ejemplo n.º 1
0
 public bool Same(NiftyInteger comparee)
 {
     if (value == comparee.value)
         return true;
     else
         return false;
 }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
 public NiftyInteger Multiply(NiftyInteger multiplicand)
 {
     NiftyInteger product = new NiftyInteger(value * multiplicand.value);
     return product;
 }
Ejemplo n.º 4
0
 public NiftyInteger(NiftyInteger aNiftyInteger)
 {
     value = aNiftyInteger.value;
 }