Exemplo n.º 1
0
 /// <summary>
 /// Verifies if the two unsigned numbers are equal
 /// </summary>
 /// <param name="n">Number to verify</param>
 public bool Equals(UNum n)
 {
     return this.value.Equals(n.value);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Tries to parse the given string into an unsigned numbers and returns if it worked
 /// </summary>
 /// <param name="s">String to parse</param>
 /// <param name="n">Value to store the result into</param>
 public static bool TryParse(string s, ref UNum n)
 {
     short result;
     bool success = short.TryParse(s, out result) && result >= minValue && result <= maxValue;
     if (success) { n = result; }
     return success;
 }