当前位置: 首页>>代码示例>>C#>>正文


C# BigInteger.RightShift方法代码示例

本文整理汇总了C#中BigInteger.RightShift方法的典型用法代码示例。如果您正苦于以下问题:C# BigInteger.RightShift方法的具体用法?C# BigInteger.RightShift怎么用?C# BigInteger.RightShift使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BigInteger的用法示例。


在下文中一共展示了BigInteger.RightShift方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RightShift_zero_is_zero

 public void RightShift_zero_is_zero()
 {
     BigInteger x = new BigInteger(0);
     BigInteger y = x.RightShift(1000);
     Expect(y.IsZero);
 }
开发者ID:richhickey,项目名称:clojure-clr,代码行数:6,代码来源:BigIntegerTests.cs

示例2: RightShift_zero_shift_is_this

 public void RightShift_zero_shift_is_this()
 {
     uint digit1 = 0xC1F0F1CD;
     uint digit2 = 0xB38F4F83;
     uint digit3 = 0x1234678;
     BigInteger x = new BigInteger(1, digit1, digit2, digit3);
     BigInteger y = x.RightShift(0);
     Expect(y, SameAs(x));
 }
开发者ID:richhickey,项目名称:clojure-clr,代码行数:9,代码来源:BigIntegerTests.cs

示例3: RightShift_pos_whole_digit_shift_loses_whole_digits

 public void RightShift_pos_whole_digit_shift_loses_whole_digits()
 {
     uint digit1 = 0xC1F0F1CD;
     uint digit2 = 0xB38F4F83;
     uint digit3 = 0x1234678;
     BigInteger x = new BigInteger(1, digit1, digit2, digit3);
     BigInteger y = x.RightShift(64);
     BigInteger w = new BigInteger(1, digit1);
     Expect(y == w);
 }
开发者ID:richhickey,项目名称:clojure-clr,代码行数:10,代码来源:BigIntegerTests.cs

示例4: RightShift_pos_small_shift

 public void RightShift_pos_small_shift()
 {
     uint digit1 = 0xC1F0F1CD;
     uint digit2 = 0xB38F4F83;
     uint digit3 = 0x1234678;
     BigInteger x = new BigInteger(1, digit1, digit2, digit3);
     BigInteger y = x.RightShift(7);
     BigInteger w = new BigInteger(1,
         digit1 >> 7 ,
         digit1 << 25 | digit2 >> 7,
         digit2 << 25 | digit3 >> 7);
     Expect(y == w);
 }
开发者ID:richhickey,项目名称:clojure-clr,代码行数:13,代码来源:BigIntegerTests.cs

示例5: RightShift_pos_big_shift_zero_high_bits

 public void RightShift_pos_big_shift_zero_high_bits()
 {
     uint digit1 = 0x00001D;
     uint digit2 = 0xB38F4F83;
     uint digit3 = 0x1234678;
     BigInteger x = new BigInteger(1, digit1, digit2, digit3);
     BigInteger y = x.RightShift(7 + 32);
     BigInteger w = new BigInteger(1,
         digit1 >> 7,
         digit1 << 25 | digit2 >> 7);
     Expect(y == w);
 }
开发者ID:richhickey,项目名称:clojure-clr,代码行数:12,代码来源:BigIntegerTests.cs

示例6: 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

示例7: RightShift_neg_big_shift

 public void RightShift_neg_big_shift()
 {
     uint digit1 = 0xC1F0F1CD;
     uint digit2 = 0xB38F4F83;
     uint digit3 = 0x1234678;
     BigInteger x = new BigInteger(-1, digit1, digit2, digit3);
     BigInteger y = x.RightShift(7 + 32);
     BigInteger w = new BigInteger(-1,
         digit1 >> 7,
         digit1 << 25 | digit2 >> 7);
     Expect(y == w);
 }
开发者ID:richhickey,项目名称:clojure-clr,代码行数:12,代码来源:BigIntegerTests.cs


注:本文中的BigInteger.RightShift方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。