本文整理汇总了C#中Tnum类的典型用法代码示例。如果您正苦于以下问题:C# Tnum类的具体用法?C# Tnum怎么用?C# Tnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Tnum类属于命名空间,在下文中一共展示了Tnum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Performance_RunningSummedIntervals_1
public void Performance_RunningSummedIntervals_1()
{
DateTime startTime = DateTime.Now;
Tnum t = new Tnum(9.99).RunningSummedIntervals(TheDay);
int ResponseTimeInMs = Convert.ToInt32((DateTime.Now - startTime).TotalMilliseconds);
Assert.IsTrue(ResponseTimeInMs < 85);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:7,代码来源:Test+-+performance.cs
示例2: ElapsedDaysPerInterval_5
public void ElapsedDaysPerInterval_5()
{
Tbool t = new Tbool(false);
Tnum n = new Tnum(Hstate.Unstated);
Tnum result = t.TotalElapsedDaysPer(n);
Assert.AreEqual("Unstated", result.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:7,代码来源:Test+-+elapsed+time+-+per+interval.cs
示例3: Misc_TemporalRecursion4
public void Misc_TemporalRecursion4()
{
Tnum x = new Tnum();
x.AddState(Time.DawnOf, 10);
x.AddState(new DateTime(2000,1,1), 1);
Assert.AreEqual("{Dawn: 89; 1/1/2000: 1}", TemporalFibonacci(x).Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:7,代码来源:Test+-+misc.cs
示例4: HasUndefinedIntervals1
public void HasUndefinedIntervals1()
{
Tnum r = new Tnum(new Hval(null,Hstate.Null));
r.AddState(Date(2000,1,1), new Hval(null,Hstate.Unstated));
r.AddState(Date(2001,1,1), 2);
Assert.AreEqual(true, Util.HasUndefinedIntervals(r));
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:8,代码来源:Test+-+switch.cs
示例5: RunningSummedIntervals_1
public void RunningSummedIntervals_1()
{
Tnum t = new Tnum(0);
t.AddState(Date(2012, 1, 1), 1000);
t.AddState(Date(2012, 3, 1), 0);
Tnum r = t.RunningSummedIntervals(TheMonth);
Assert.AreEqual("{Dawn: 0; 2/1/2012: 1000; 3/1/2012: 2000}", r.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:8,代码来源:Test+-+summed+intervals.cs
示例6: AssignAndMerge1
public void AssignAndMerge1()
{
Tbool newCondition = new Tbool(Hstate.Uncertain);
Tnum initialResult = new Tnum(Hstate.Null);
Tbool newConditionIsUnknown = new Tbool(true);
Tnum result = Util.MergeTvars<Tnum>(initialResult,
Util.ConditionalAssignment<Tnum>(newConditionIsUnknown, newCondition));
Assert.AreEqual("Uncertain", result.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:11,代码来源:Test+-+switch.cs
示例7: AssignAndMerge2
public void AssignAndMerge2()
{
Tbool newCondition = new Tbool(Hstate.Uncertain);
Tnum initialResult = new Tnum(Hstate.Null);
Tbool newConditionIsUnknown = new Tbool(true);
Tnum result = Util.MergeTvars<Tnum>(initialResult,
Util.ConditionalAssignment<Tnum>(newConditionIsUnknown, newCondition));
Assert.AreEqual(false, Util.HasUndefinedIntervals(result));
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:11,代码来源:Test+-+switch.cs
示例8: RunningSummedIntervals_3
public void RunningSummedIntervals_3()
{
Tnum t = new Tnum(Hstate.Unstated);
Tnum r = t.RunningSummedIntervals(TheMonth);
Assert.AreEqual("Unstated", r.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:6,代码来源:Test+-+summed+intervals.cs
示例9: RunningSummedIntervals_2
public void RunningSummedIntervals_2()
{
Tnum t = new Tnum(0);
Tnum r = t.RunningSummedIntervals(TheMonth);
Assert.AreEqual(0, r.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:6,代码来源:Test+-+summed+intervals.cs
示例10: Up3
public void Up3()
{
Tnum res = new Tnum(7.33).RoundUp(0.25);
Assert.AreEqual(7.50, res.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:5,代码来源:Test+-+rounding+fcns.cs
示例11: TotalSummedIntervals_5
public void TotalSummedIntervals_5()
{
Tnum t = new Tnum(1000);
t.AddState(Date(2015, 6, 1), 2000);
Tnum r = t.TotalSummedIntervals(TheMonth, Date(2015,1,1), Date(2016,1,1));
Assert.AreEqual(19000, r.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:7,代码来源:Test+-+summed+intervals.cs
示例12: Up5
public void Up5()
{
Tnum res = new Tnum(1324103).RoundUp(50000);
Assert.AreEqual(1350000, res.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:5,代码来源:Test+-+rounding+fcns.cs
示例13: SlidingSummedIntervals_3
public void SlidingSummedIntervals_3()
{
Tnum t = new Tnum(Hstate.Stub);
Tnum r = t.SlidingSummedIntervals(TheMonth, 2);
Assert.AreEqual("Stub", r.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:6,代码来源:Test+-+summed+intervals.cs
示例14: SlidingSummedIntervals_1
public void SlidingSummedIntervals_1()
{
Tnum t = new Tnum(1000);
Tnum r = t.SlidingSummedIntervals(TheMonth, 2);
Assert.AreEqual(2000, r.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:6,代码来源:Test+-+summed+intervals.cs
示例15: SlidingSummedIntervals_4
public void SlidingSummedIntervals_4()
{
Tnum t = new Tnum(1000);
t.AddState(Date(2013, 1, 1), 2000);
Tnum r = t.SlidingSummedIntervals(TheYear, 2);
Assert.AreEqual("{Dawn: 2000; 1/1/2014: 3000; 1/1/2015: 4000}", r.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:7,代码来源:Test+-+summed+intervals.cs
示例16: Near3
public void Near3()
{
Tnum res = new Tnum(125).RoundToNearest(10);
Assert.AreEqual(130, res.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:5,代码来源:Test+-+rounding+fcns.cs
示例17: Near10
public void Near10()
{
Tnum res = new Tnum(88.34).RoundToNearest(1);
Assert.AreEqual(88.00, res.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:5,代码来源:Test+-+rounding+fcns.cs
示例18: Down5
public void Down5()
{
Tnum res = new Tnum(0).RoundDown(1);
Assert.AreEqual(0, res.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:5,代码来源:Test+-+rounding+fcns.cs
示例19: Down4
public void Down4()
{
Tnum res = new Tnum(1324103).RoundDown(50000);
Assert.AreEqual(1300000, res.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:5,代码来源:Test+-+rounding+fcns.cs
示例20: Down3
public void Down3()
{
Tnum res = new Tnum(7.5).RoundDown(0.25);
Assert.AreEqual(7.5, res.Out);
}
开发者ID:mpoulshock,项目名称:hammurabi,代码行数:5,代码来源:Test+-+rounding+fcns.cs
注:本文中的Tnum类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论