if (v > Int32.MaxValue || v < Int32.MinValue) throw new ArgumentException(String.Format("Value will overflow, prevented initialization, proper range for Int32 is: [{0}, {1}]", Int32.MinValue, Int32.MaxValue));
public static Integer operator +(Integer o1, Integer o2)
return new Integer(o1.Value() + o2.Value());
public static Integer operator -(Integer o1, Integer o2)
return new Integer(o1.Value() - o2.Value());
public static Integer operator *(Integer o1, Integer o2)
return new Integer(o1.Value() * o2.Value());
public static Integer operator ^(Integer o1, Integer o2)
return new Integer((int)Math.Pow(o1.Value(), o2.Value()));
public static Integer operator /(Integer o1, Integer o2)
throw new ArgumentException("right side operator cannot be zero");
return new Integer( (int)Math.Round( (double)o1.Value() / (double)o2.Value() ));
public int Value() { return this.i; }
Console.WriteLine("{0}", this.i );
public static void Main()
Console.WriteLine("Hello World");
Integer v2 = new Integer(2);
Integer v10 = new Integer(10);
Integer v14 = new Integer(14);
Integer v20 = new Integer(20);
Integer div1 = v20 / v10;
Integer div2 = v14 / v10;