コード例 #1
0
ファイル: Value.cs プロジェクト: Amichai/Physics-Engine
 /// <summary>Decimal value</summary>
 public void InitDouble(double val, Restrictions restrictions)
 {
     this.deciValue = val;
     if (val == Math.Floor(val)) {
         //this is done to avoid the accumulation of miniscule errors:
         deciValue = Math.Floor(val);
         primaryNumType = NumberType.integer;
         if (restrictions != Restrictions.dontFactorMe && restrictions != Restrictions.dontFactorDontSetFraction) {
             factors = new Factors((int)deciValue);
         }
         natural = new MathNet.Numerics.Natural();
     }else if (restrictions != Restrictions.dontSetToFraction && restrictions != Restrictions.dontFactorDontSetFraction) {
         asAFraction = decimalToFraction(deciValue);
     }
     this.primaryNumType = NumberType.deci;
 }
コード例 #2
0
ファイル: Value.cs プロジェクト: Amichai/Physics-Engine
 public Value(double doubleVal, Factors factors, Restrictions restrictions)
 {
     InitDouble(doubleVal, restrictions);
 }
コード例 #3
0
 public Value(double doubleVal, Factors factors, Restrictions restrictions)
 {
     InitDouble(doubleVal, restrictions);
 }