コード例 #1
0
 public void SetSeconds(decimal sec)
 {
     this.Seconds = Rational <uint> .Approximate(sec);
 }
コード例 #2
0
 public void SetDegrees(decimal deg)
 {
     this.Degrees = Rational <uint> .Approximate(deg);
 }
コード例 #3
0
 public void SetMinutes(decimal min)
 {
     this.Minutes = Rational <uint> .Approximate(min);
 }
コード例 #4
0
ファイル: Rational.cs プロジェクト: twobob/exif-utils.net
		/// <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);
		}