Exemplo n.º 1
0
 public void SetSeconds(decimal sec)
 {
     this.Seconds = Rational <uint> .Approximate(sec);
 }
Exemplo n.º 2
0
 public void SetDegrees(decimal deg)
 {
     this.Degrees = Rational <uint> .Approximate(deg);
 }
Exemplo n.º 3
0
 public void SetMinutes(decimal min)
 {
     this.Minutes = Rational <uint> .Approximate(min);
 }
Exemplo n.º 4
0
		/// <summary>
		/// Approximate the decimal value accurate to a precision of 0.000001m
		/// </summary>
		/// <param name="value">decimal value to approximate</param>
		/// <returns>an approximation of the value as a rational number</returns>
		/// <remarks>
		/// http://stackoverflow.com/questions/95727
		/// </remarks>
		public static Rational<T> Approximate(decimal value)
		{
			return Rational<T>.Approximate(value, 0.000001m);
		}