當前位置: 首頁>>代碼示例>>C#>>正文


C# BigInteger.LeftShift方法代碼示例

本文整理匯總了C#中BigInteger.LeftShift方法的典型用法代碼示例。如果您正苦於以下問題:C# BigInteger.LeftShift方法的具體用法?C# BigInteger.LeftShift怎麽用?C# BigInteger.LeftShift使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BigInteger的用法示例。


在下文中一共展示了BigInteger.LeftShift方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LeftShift_zero_shift_is_this

 public void LeftShift_zero_shift_is_this()
 {
     uint digit1 = 0xC1F0F1CD;
     uint digit2 = 0xB38F4F83;
     uint digit3 = 0x1234678;
     BigInteger x = new BigInteger(1, digit1, digit2, digit3);
     BigInteger y = x.LeftShift(0);
     Expect(y, SameAs(x));
 }
開發者ID:richhickey,項目名稱:clojure-clr,代碼行數:9,代碼來源:BigIntegerTests.cs

示例2: RightShift_neg_shift_same_as_left_shift

 public void RightShift_neg_shift_same_as_left_shift()
 {
     uint digit1 = 0xC1F0F1CD;
     uint digit2 = 0xB38F4F83;
     uint digit3 = 0x1234678;
     BigInteger x = new BigInteger(1, digit1, digit2, digit3);
     BigInteger y = x.RightShift(-40);
     BigInteger z = x.LeftShift(40);
     Expect(y == z);
 }
開發者ID:richhickey,項目名稱:clojure-clr,代碼行數:10,代碼來源:BigIntegerTests.cs

示例3: LeftShift_zero_is_zero

 public void LeftShift_zero_is_zero()
 {
     BigInteger x = new BigInteger(0);
     BigInteger y = x.LeftShift(1000);
     Expect(y.IsZero);
 }
開發者ID:richhickey,項目名稱:clojure-clr,代碼行數:6,代碼來源:BigIntegerTests.cs

示例4: LeftShift_pos_whole_digit_shift_adds_zeros_at_end

 public void LeftShift_pos_whole_digit_shift_adds_zeros_at_end()
 {
     uint digit1 = 0xC1F0F1CD;
     uint digit2 = 0xB38F4F83;
     uint digit3 = 0x1234678;
     BigInteger x = new BigInteger(1, digit1, digit2, digit3);
     BigInteger y = x.LeftShift(64);
     BigInteger w = new BigInteger(1, digit1, digit2, digit3, 0, 0);
     Expect(y == w);
 }
開發者ID:richhickey,項目名稱:clojure-clr,代碼行數:10,代碼來源:BigIntegerTests.cs

示例5: LeftShift_pos_small_shift

 public void LeftShift_pos_small_shift()
 {
     uint digit1 = 0xC1F0F1CD;
     uint digit2 = 0xB38F4F83;
     uint digit3 = 0x1234678;
     BigInteger x = new BigInteger(1, digit1, digit2, digit3);
     BigInteger y = x.LeftShift(7);
     BigInteger w = new BigInteger(1,
         digit1>>25,
         digit1 << 7 | digit2 >>25,
         digit2 << 7 | digit3 >> 25,
         digit3 << 7);
     Expect(y == w);
 }
開發者ID:richhickey,項目名稱:clojure-clr,代碼行數:14,代碼來源:BigIntegerTests.cs

示例6: LeftShift_pos_big_shift_zero_high_bits

 public void LeftShift_pos_big_shift_zero_high_bits()
 {
     uint digit1 = 0x0000F1CD;
     uint digit2 = 0xB38F4F83;
     uint digit3 = 0x1234678;
     BigInteger x = new BigInteger(1, digit1, digit2, digit3);
     BigInteger y = x.LeftShift(7 + 64);
     BigInteger w = new BigInteger(1,
         digit1 >> 25,
         digit1 << 7 | digit2 >> 25,
         digit2 << 7 | digit3 >> 25,
         digit3 << 7,
         0, 0);
     Expect(y == w);
 }
開發者ID:richhickey,項目名稱:clojure-clr,代碼行數:15,代碼來源:BigIntegerTests.cs

示例7: LeftShift_neg_big_shift

 public void LeftShift_neg_big_shift()
 {
     uint digit1 = 0xC1F0F1CD;
     uint digit2 = 0xB38F4F83;
     uint digit3 = 0x1234678;
     BigInteger x = new BigInteger(-1, digit1, digit2, digit3);
     BigInteger y = x.LeftShift(7 + 64);
     BigInteger w = new BigInteger(-1,
         digit1 >> 25,
         digit1 << 7 | digit2 >> 25,
         digit2 << 7 | digit3 >> 25,
         digit3 << 7,
         0, 0);
     Expect(y == w);
 }
開發者ID:richhickey,項目名稱:clojure-clr,代碼行數:15,代碼來源:BigIntegerTests.cs


注:本文中的BigInteger.LeftShift方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。