static void Main() { Numar n = new Numar(435345345); Console.WriteLine(n.Hex); Console.WriteLine(n.ConvertToBase(2)); Console.WriteLine(n.Add(new Numar(34)).Value); Console.WriteLine(n.Div(new Numar(10)).Value); Console.ReadKey(); return; }
/// <summary> /// Returneaza catul intreg a doua numere de tip Numar /// </summary> /// <param name="b"> deimpartitul </param> /// <returns>un obiect de tip Numar </returns> public Numar Div(Numar b) { return(new Numar(Value / b.Value)); }
/// <summary> /// Returneaza restul a doua numere de tip Numar /// </summary> /// <param name="b"> deimpartitul </param> /// <returns>un obiect de tip Numar </returns> public Numar Mod(Numar b) { return(new Numar(Value % b.Value)); }
/// <summary> /// Inmulteste doua numere de tip Numar. /// </summary> /// <param name="b"> al doilea factor </param> /// <returns>un obiect de tip Numar </returns> public Numar Multiply(Numar b) { return(new Numar(Value * b.Value)); }
/// <summary> /// Scade doua numere de tip Numar. /// </summary> /// <param name="b">descazutul </param> /// <returns>un obiect de tip Numar </returns> public Numar Subtract(Numar b) { return(new Numar((ulong)Math.Abs((float)(Value - b.Value)))); }
/// <summary> /// Aduna doua numere de tip Numar. /// </summary> /// <param name="b">al doilea termen din suma </param> /// <returns>un obiect detip Numar </returns> public Numar Add(Numar b) { Numar sum = new Numar(v + b.Value); return(sum); }