本文整理匯總了C#中System.Number.Construct方法的典型用法代碼示例。如果您正苦於以下問題:C# Number.Construct方法的具體用法?C# Number.Construct怎麽用?C# Number.Construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Number
的用法示例。
在下文中一共展示了Number.Construct方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
static void Main(string[] args)
{
//constant
var one = new Number<Bit>();
one.Construct();
//a few additions
var two = one.Add(one);
var three = one.Add(two);
var six = three.Add(three);
var ten = one.Add(three.Add(six));
//proof that any regular object can be used, not just one which represents a bit
var anotherOne = new Number<Number<Bit>>();
anotherOne.Construct();
var four = anotherOne.Add(anotherOne.Add(anotherOne.Add(anotherOne)));
//display results
Console.WriteLine("one: {0}: '{1}'", one.Evaluate(), one);
Console.WriteLine("two: {0}: '{1}'", two.Evaluate(), two);
Console.WriteLine("three: {0}: '{1}'", three.Evaluate(), three);
Console.WriteLine("four: {0}: '{1}'", four.Evaluate(), four);
Console.WriteLine("six: {0}: '{1}'", six.Evaluate(), six);
Console.WriteLine("ten: {0}: '{1}'", ten.Evaluate(), ten);
Console.ReadKey();
}