• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Tnum类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ToastPrompt类代码示例发布时间:2022-05-24
下一篇:
C# TlsContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap