• Home
  • Raw
  • Download

Lines Matching refs:BigInt

17     assert new BigInt("10").operatorBitwiseAnd(new BigInt("2")).toString().equals("2");
18 assert new BigInt("256").operatorBitwiseAnd(new BigInt("1")).toString().equals("0");
19 …assert new BigInt("3124378143267041203423").operatorBitwiseAnd(new BigInt("43621978")).toString().…
20 assert new BigInt("256").operatorBitwiseAnd(new BigInt("256")).toString().equals("256");
21 assert new BigInt("12345678").operatorBitwiseAnd(new BigInt("1234")).toString().equals("66");
25 assert new BigInt("10").operatorBitwiseOr(new BigInt("2")).toString().equals("10");
26 assert new BigInt("256").operatorBitwiseOr(new BigInt("1")).toString().equals("257");
27 assert new BigInt("256").operatorBitwiseOr(new BigInt("256")).toString().equals("256");
28 …assert new BigInt("3124378143267041203423").operatorBitwiseOr(new BigInt("43621978")).toString().e…
29 … assert new BigInt("12345678").operatorBitwiseOr(new BigInt("1234")).toString().equals("12346846");
33 assert new BigInt("10").operatorBitwiseXor(new BigInt("2")).toString().equals("8");
34 assert new BigInt("256").operatorBitwiseXor(new BigInt("1")).toString().equals("257");
35 assert new BigInt("256").operatorBitwiseXor(new BigInt("256")).toString().equals("0");
36 …assert new BigInt("3124378143267041203423").operatorBitwiseXor(new BigInt("43621978")).toString().…
37 …assert new BigInt("12345678").operatorBitwiseXor(new BigInt("1234")).toString().equals("12346780");
41 assert new BigInt("0").operatorLeftShift(new BigInt("0")).toString().equals("0");
42 assert new BigInt("0").operatorLeftShift(new BigInt("1")).toString().equals("0");
43 assert new BigInt("1").operatorLeftShift(new BigInt("0")).toString().equals("1");
44 assert new BigInt("10").operatorLeftShift(new BigInt("2")).toString().equals("40");
45 … assert new BigInt("255").operatorLeftShift(new BigInt("41")).toString().equals("560750930165760");
46 …assert new BigInt("65535").operatorLeftShift(new BigInt("60")).toString().equals("7555671080440971…
47 …assert new BigInt("4294967295").operatorLeftShift(new BigInt("5")).toString().equals("137438953440…
48 …assert new BigInt("18446744073709551615").operatorLeftShift(new BigInt("6")).toString().equals("11…
49 …assert new BigInt("1275418875248948586535904902545412130").operatorLeftShift(new BigInt("123")).to…
50 …assert new BigInt("2").operatorLeftShift(new BigInt("218")).toString().equals("8424983333484574935…
51 assert new BigInt("-1").operatorLeftShift(new BigInt("0")).toString().equals("-1");
52 assert new BigInt("-12").operatorLeftShift(new BigInt("4")).toString().equals("-192");
53 assert new BigInt("-255").operatorLeftShift(new BigInt("19")).toString().equals("-133693440");
54 …assert new BigInt("-65535").operatorLeftShift(new BigInt("73")).toString().equals("-61896057490972…
55 …assert new BigInt("-4294967295").operatorLeftShift(new BigInt("24")).toString().equals("-720575940…
56 …assert new BigInt("-18446744073709551615").operatorLeftShift(new BigInt("31")).toString().equals("…
57 …assert new BigInt("-4095059032950818422890113130149234924134").operatorLeftShift(new BigInt("103")…
61 assert new BigInt("-200").operatorRightShift(new BigInt("2")).toString().equals("-50");
62 assert new BigInt("-12").operatorRightShift(new BigInt("2")).toString().equals("-3");
63 assert new BigInt("-1").operatorRightShift(new BigInt("0")).toString().equals("-1");
64 assert new BigInt("0").operatorRightShift(new BigInt("0")).toString().equals("0");
65 assert new BigInt("0").operatorRightShift(new BigInt("1")).toString().equals("0");
66 assert new BigInt("1").operatorRightShift(new BigInt("0")).toString().equals("1");
67 assert new BigInt("55").operatorRightShift(new BigInt("2")).toString().equals("13");
68 assert new BigInt("-50").operatorRightShift(new BigInt("2")).toString().equals("-13");
69 assert new BigInt("255").operatorRightShift(new BigInt("4")).toString().equals("15");
70 assert new BigInt("255").operatorRightShift(new BigInt("8")).toString().equals("0");
71 assert new BigInt("65535").operatorRightShift(new BigInt("10")).toString().equals("63");
72 assert new BigInt("4294967295").operatorRightShift(new BigInt("17")).toString().equals("32767");
73 assert new BigInt("4294967295").operatorRightShift(new BigInt("48")).toString().equals("0");
74 …assert new BigInt("18446744073709551615").operatorRightShift(new BigInt("55")).toString().equals("…
75 …assert new BigInt("4930493049034092989191918392837727383823827").operatorRightShift(new BigInt("12…
76 …assert new BigInt("34930693049034092980065918370009389341341932481328231493102392100010239").opera…
77BigInt("340954059039002934990340240294092000000000000000000000940493043942849939393829493849849810…
78 assert new BigInt("-255").operatorRightShift(new BigInt("2")).toString().equals("-64");
79 assert new BigInt("-65535").operatorRightShift(new BigInt("12")).toString().equals("-16");
80 … assert new BigInt("-4294967295").operatorRightShift(new BigInt("18")).toString().equals("-16384");
81 …assert new BigInt("-18446744073709551615").operatorRightShift(new BigInt("38")).toString().equals(…
82 …assert new BigInt("-4095059032950818422890113130149234924134").operatorRightShift(new BigInt("99")…
83 …t new BigInt("-32943029409402940949230405920593025909502945029402940290294090294290429420490281001…
87 assert new BigInt("10").operatorModule(new BigInt("3")).toString().equals("1");
88 assert new BigInt("10").operatorModule(new BigInt("-3")).toString().equals("1");
89 assert new BigInt("-10").operatorModule(new BigInt("3")).toString().equals("-1");
90 assert new BigInt("-10").operatorModule(new BigInt("-3")).toString().equals("-1");
91 assert new BigInt("100").operatorModule(new BigInt("50")).toString().equals("0");
92 assert new BigInt("100").operatorModule(new BigInt("-50")).toString().equals("0");
93 assert new BigInt("-100").operatorModule(new BigInt("50")).toString().equals("0");
94 assert new BigInt("-100").operatorModule(new BigInt("-50")).toString().equals("0");
95 …assert new BigInt("3124378143267041203423").operatorModule(new BigInt("43621978")).toString().equa…
96 …assert new BigInt("-3124378143267041203423").operatorModule(new BigInt("43621978")).toString().equ…
97 …assert new BigInt("3124378143267041203423").operatorModule(new BigInt("-43621978")).toString().equ…
98 …assert new BigInt("-3124378143267041203423").operatorModule(new BigInt("-43621978")).toString().eq…
99 assert new BigInt("100").operatorModule(new BigInt("250")).toString().equals("100");
100 assert new BigInt("-100").operatorModule(new BigInt("250")).toString().equals("-100");
101 assert new BigInt("100").operatorModule(new BigInt("-250")).toString().equals("100");
102 assert new BigInt("-100").operatorModule(new BigInt("-250")).toString().equals("-100");
103 assert new BigInt("0").operatorModule(new BigInt("8")).toString().equals("0");
107 assert new BigInt("10").operatorDivide(new BigInt("3")).toString().equals("3");
108 assert new BigInt("-10").operatorDivide(new BigInt("3")).toString().equals("-3");
109 assert new BigInt("10").operatorDivide(new BigInt("-3")).toString().equals("-3");
110 assert new BigInt("-10").operatorDivide(new BigInt("-3")).toString().equals("3");
111 assert new BigInt("100").operatorDivide(new BigInt("50")).toString().equals("2");
112 assert new BigInt("100").operatorDivide(new BigInt("-50")).toString().equals("-2");
113 assert new BigInt("-100").operatorDivide(new BigInt("50")).toString().equals("-2");
114 assert new BigInt("-100").operatorDivide(new BigInt("-50")).toString().equals("2");
115 …assert new BigInt("3124378143267041203423").operatorDivide(new BigInt("43621978")).toString().equa…
116 …assert new BigInt("-3124378143267041203423").operatorDivide(new BigInt("43621978")).toString().equ…
117 …assert new BigInt("3124378143267041203423").operatorDivide(new BigInt("-43621978")).toString().equ…
118 …assert new BigInt("-3124378143267041203423").operatorDivide(new BigInt("-43621978")).toString().eq…
119 assert new BigInt("100").operatorDivide(new BigInt("250")).toString().equals("0");
120 assert new BigInt("100").operatorDivide(new BigInt("-250")).toString().equals("0");
121 assert new BigInt("-100").operatorDivide(new BigInt("250")).toString().equals("0");
122 assert new BigInt("-100").operatorDivide(new BigInt("-250")).toString().equals("0");
123 assert new BigInt("65000").operatorDivide(new BigInt("100")).toString().equals("650");
124 assert new BigInt("65000").operatorDivide(new BigInt("-100")).toString().equals("-650");
125 assert new BigInt("-65000").operatorDivide(new BigInt("100")).toString().equals("-650");
126 assert new BigInt("-65000").operatorDivide(new BigInt("-100")).toString().equals("650");
130 assert new BigInt("10").negate().toString().equals("-10");
131 assert new BigInt("1000").negate().toString().equals("-1000");
132 assert new BigInt("-1").negate().toString().equals("1");
133 assert new BigInt("-10").negate().toString().equals("10");
134 assert new BigInt("-100").negate().toString().equals("100");
135 assert new BigInt("0").negate().toString().equals("0");
139 assert new BigInt("10").operatorAdd(new BigInt("20")).toString() == "30";
140 assert new BigInt("1000").operatorAdd(new BigInt("10")).toString() == "1010";
141 assert new BigInt("-10").operatorAdd(new BigInt("9")).toString() == "-1";
142 assert new BigInt("-10").operatorAdd(new BigInt("10")).toString() == "0";
143 assert new BigInt("-100").operatorAdd(new BigInt("10")).toString() == "-90";
144 assert new BigInt("100").operatorAdd(new BigInt("10")).toString() == "110";
145 assert new BigInt("65535").operatorAdd(new BigInt("65535")).toString() == "131070";
146 assert new BigInt("65500").operatorAdd(new BigInt("1")).toString().equals("65501");
147 assert new BigInt("65500").operatorAdd(new BigInt("-1")).toString().equals("65499");
148 assert new BigInt("-65500").operatorAdd(new BigInt("-1")).toString().equals("-65501");
149 assert new BigInt("-65500").operatorAdd(new BigInt("1")).toString().equals("-65499");
150 assert new BigInt("-65500").operatorAdd(new BigInt("100000")).toString().equals("34500");
151 assert new BigInt("100").operatorAdd(new BigInt("0")).toString().equals("100");
152 assert new BigInt("-100").operatorAdd(new BigInt("0")).toString().equals("-100");
153 assert new BigInt("-10").operatorAdd(new BigInt("-10")).toString().equals("-20");
157 assert new BigInt("10").operatorSubtract(new BigInt("2")).toString().equals("8");
158 assert new BigInt("2").operatorSubtract(new BigInt("10")).toString().equals("-8");
159 assert new BigInt("-10").operatorSubtract(new BigInt("-2")).toString().equals("-8");
160 assert new BigInt("-100").operatorSubtract(new BigInt("1")).toString().equals("-101");
161 assert new BigInt("-100").operatorSubtract(new BigInt("-1")).toString().equals("-99");
162 assert new BigInt("-1000").operatorSubtract(new BigInt("10")).toString().equals("-1010");
163 …assert new BigInt("1237840127434312471243").operatorSubtract(new BigInt("2341123423145269146723421…
164 …assert new BigInt("-1237840127434312471243").operatorSubtract(new BigInt("234112342314526914672342…
165 …assert new BigInt("1237840127434312471243").operatorSubtract(new BigInt("-234112342314526914672342…
166 …assert new BigInt("-1237840127434312471243").operatorSubtract(new BigInt("-23411234231452691467234…
167 assert new BigInt("-1000").operatorSubtract(new BigInt("-10")).toString().equals("-990");
168 assert new BigInt("-100").operatorSubtract(new BigInt("0")).toString().equals("-100");
169 assert new BigInt("0").operatorSubtract(new BigInt("-100")).toString().equals("100");
170 assert new BigInt("0").operatorSubtract(new BigInt("100")).toString().equals("-100");
171 assert new BigInt("65500").operatorSubtract(new BigInt("1")).toString().equals("65499");
172 assert new BigInt("65500").operatorSubtract(new BigInt("-1")).toString().equals("65501");
173 assert new BigInt("-65500").operatorSubtract(new BigInt("-1")).toString().equals("-65499");
174 assert new BigInt("-65500").operatorSubtract(new BigInt("1")).toString().equals("-65501");
175 assert new BigInt("65500").operatorSubtract(new BigInt("100000")).toString().equals("-34500");
176 …assert new BigInt("49798775").operatorSubtract(new BigInt("43621978")).toString().equals("6176797"…
177 assert new BigInt("10").operatorSubtract(new BigInt("20")).toString().equals("-10");
181 assert new BigInt("10").operatorMultiply(new BigInt("10")).toString() == "100";
182 assert new BigInt("0").operatorMultiply(new BigInt("50")).toString() == "0";
183 assert new BigInt("1").operatorMultiply(new BigInt("50")).toString() == "50";
184 assert new BigInt("50").operatorMultiply(new BigInt("5")).toString() == "250";
185 assert new BigInt("50").operatorMultiply(new BigInt("-5")).toString() == "-250";
186 assert new BigInt("-1").operatorMultiply(new BigInt("-5")).toString() == "5";
187 assert new BigInt("0").operatorMultiply(new BigInt("0")).toString() == "0";
188 assert new BigInt("123").operatorMultiply(new BigInt("1")).toString() == "123";
189 assert new BigInt("1234").operatorMultiply(new BigInt("987")).toString() == "1217958";
190 …assert new BigInt("3241847031247230147213740214703214721047312").operatorMultiply(new BigInt("4123…
191 …assert new BigInt("-3241847031247230147213740214703214721047312").operatorMultiply(new BigInt("-41…
192 …assert new BigInt("-3241847031247230147213740214703214721047312").operatorMultiply(new BigInt("412…
193 …assert new BigInt("3241847031247230147213740214703214721047312").operatorMultiply(new BigInt("-412…
194 assert new BigInt("256").operatorMultiply(new BigInt("256")).toString() == "65536";
198 let a = new BigInt()
202 let b = new BigInt("")
212 assert new BigInt("10").toString() == "10"
213 assert new BigInt("1000").toString() == "1000"
214 assert new BigInt("-1000").toString() == "-1000"
215 assert new BigInt("-1").toString() == "-1"
216 assert new BigInt("-10").toString() == "-10"
217 assert new BigInt("-100").toString() == "-100"
218 assert new BigInt("-100000000000000").toString() == "-100000000000000"
219 assert new BigInt("0").toString() == "0"
379 /* Testing BigInt constructor */
380 let n0 = new BigInt(0)
384 let n1 = new BigInt(654093)
388 let n2 = new BigInt(b)
392 let n3 = new BigInt(s)
396 let n4 = new BigInt(i)
400 let n5 = new BigInt(l)
404 let dec = new BigInt("-12392320390239294724747283477947923471101032")
410 // assert BigInt.asIntN(0, n7) == 0n
411 // assert BigInt.asIntN(8, n7) == 104n
412 // assert BigInt.asIntN(16, n7) == 27752n
413 // assert BigInt.asIntN(32, n7) == -737317784n
414 // assert BigInt.asIntN(64, n7) == -7098331616643290008n
417 // assert BigInt.asUintN(0, n7) == 0n
418 // assert BigInt.asUintN(8, n7) == 104n
419 // assert BigInt.asUintN(16, n7) == 27752n
420 // assert BigInt.asUintN(32, n7) == 3557649512n
421 // assert BigInt.asUintN(64, n7) == 11348412457066261608n
480 a = new BigInt(321);