3
3
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
4
4
// -------------------------------------------------------------------------------------------------------
5
5
#include " CommonDataStructuresPch.h"
6
- #include " DataStructures/BigInt .h"
6
+ #include " DataStructures/BigUInt .h"
7
7
#include " Common/NumberUtilitiesBase.h"
8
8
#include " Common/NumberUtilities.h"
9
9
10
10
namespace Js
11
11
{
12
- BigInt & BigInt ::operator = (BigInt &bi)
12
+ BigUInt & BigUInt ::operator = (BigUInt &bi)
13
13
{
14
14
AssertMsg (false , " can't assign BigInts" );
15
15
return *this ;
16
16
}
17
17
18
18
#if DBG
19
- void BigInt ::AssertValid (bool fCheckVal )
19
+ void BigUInt ::AssertValid (bool fCheckVal )
20
20
{
21
21
Assert (m_cluMax >= kcluMaxInit);
22
22
Assert (m_prglu != 0 );
@@ -26,33 +26,33 @@ namespace Js
26
26
}
27
27
#endif
28
28
29
- BigInt::BigInt (void )
29
+ BigUInt::BigUInt (void )
30
30
{
31
31
m_cluMax = kcluMaxInit;
32
32
m_clu = 0 ;
33
33
m_prglu = m_rgluInit;
34
34
AssertBi (this );
35
35
}
36
36
37
- BigInt ::~BigInt (void )
37
+ BigUInt ::~BigUInt (void )
38
38
{
39
39
if (m_prglu != m_rgluInit)
40
40
free (m_prglu);
41
41
}
42
42
43
- int32 BigInt ::Clu (void )
43
+ int32 BigUInt ::Clu (void )
44
44
{
45
45
return m_clu;
46
46
}
47
47
48
- uint32 BigInt ::Lu (int32 ilu)
48
+ uint32 BigUInt ::Lu (int32 ilu)
49
49
{
50
50
AssertBi (this );
51
51
Assert (ilu < m_clu);
52
52
return m_prglu[ilu];
53
53
}
54
54
55
- bool BigInt ::FResize (int32 clu)
55
+ bool BigUInt ::FResize (int32 clu)
56
56
{
57
57
AssertBiNoVal (this );
58
58
@@ -79,7 +79,7 @@ namespace Js
79
79
return true ;
80
80
}
81
81
82
- bool BigInt ::FInitFromRglu (uint32 *prglu, int32 clu)
82
+ bool BigUInt ::FInitFromRglu (uint32 *prglu, int32 clu)
83
83
{
84
84
AssertBi (this );
85
85
Assert (clu >= 0 );
@@ -95,7 +95,7 @@ namespace Js
95
95
return true ;
96
96
}
97
97
98
- bool BigInt ::FInitFromBigint (BigInt *pbiSrc)
98
+ bool BigUInt ::FInitFromBigint (BigUInt *pbiSrc)
99
99
{
100
100
AssertBi (this );
101
101
AssertBi (pbiSrc);
@@ -105,7 +105,7 @@ namespace Js
105
105
}
106
106
107
107
template <typename EncodedChar>
108
- bool BigInt ::FInitFromDigits (const EncodedChar *prgch, int32 cch, int32 *pcchDig)
108
+ bool BigUInt ::FInitFromDigits (const EncodedChar *prgch, int32 cch, int32 *pcchDig)
109
109
{
110
110
AssertBi (this );
111
111
Assert (cch >= 0 );
@@ -147,7 +147,7 @@ namespace Js
147
147
return true ;
148
148
}
149
149
150
- bool BigInt ::FMulAdd (uint32 luMul, uint32 luAdd)
150
+ bool BigUInt ::FMulAdd (uint32 luMul, uint32 luAdd)
151
151
{
152
152
AssertBi (this );
153
153
Assert (luMul != 0 );
@@ -174,7 +174,7 @@ namespace Js
174
174
return true ;
175
175
}
176
176
177
- bool BigInt ::FMulPow5 (int32 c5)
177
+ bool BigUInt ::FMulPow5 (int32 c5)
178
178
{
179
179
AssertBi (this );
180
180
Assert (c5 >= 0 );
@@ -203,7 +203,7 @@ namespace Js
203
203
return true ;
204
204
}
205
205
206
- bool BigInt ::FShiftLeft (int32 cbit)
206
+ bool BigUInt ::FShiftLeft (int32 cbit)
207
207
{
208
208
AssertBi (this );
209
209
Assert (cbit >= 0 );
@@ -258,7 +258,7 @@ namespace Js
258
258
return true ;
259
259
}
260
260
261
- void BigInt ::ShiftLusRight (int32 clu)
261
+ void BigUInt ::ShiftLusRight (int32 clu)
262
262
{
263
263
AssertBi (this );
264
264
Assert (clu >= 0 );
@@ -278,7 +278,7 @@ namespace Js
278
278
AssertBi (this );
279
279
}
280
280
281
- void BigInt ::ShiftRight (int32 cbit)
281
+ void BigUInt ::ShiftRight (int32 cbit)
282
282
{
283
283
AssertBi (this );
284
284
Assert (cbit >= 0 );
@@ -312,7 +312,7 @@ namespace Js
312
312
AssertBi (this );
313
313
}
314
314
315
- int BigInt ::Compare (BigInt *pbi)
315
+ int BigUInt ::Compare (BigUInt *pbi)
316
316
{
317
317
AssertBi (this );
318
318
AssertBi (pbi);
@@ -338,7 +338,7 @@ namespace Js
338
338
return (m_prglu[ilu] > pbi->m_prglu [ilu]) ? 1 : -1 ;
339
339
}
340
340
341
- bool BigInt ::FAdd (BigInt *pbi)
341
+ bool BigUInt ::FAdd (BigUInt *pbi)
342
342
{
343
343
AssertBi (this );
344
344
AssertBi (pbi);
@@ -391,7 +391,7 @@ namespace Js
391
391
return true ;
392
392
}
393
393
394
- void BigInt ::Subtract (BigInt *pbi)
394
+ void BigUInt ::Subtract (BigUInt *pbi)
395
395
{
396
396
AssertBi (this );
397
397
AssertBi (pbi);
@@ -443,7 +443,7 @@ namespace Js
443
443
AssertBi (this );
444
444
}
445
445
446
- int BigInt ::DivRem (BigInt *pbi)
446
+ int BigUInt ::DivRem (BigUInt *pbi)
447
447
{
448
448
AssertBi (this );
449
449
AssertBi (pbi);
@@ -510,7 +510,7 @@ namespace Js
510
510
return wQuo;
511
511
}
512
512
513
- double BigInt ::GetDbl (void )
513
+ double BigUInt ::GetDbl (void )
514
514
{
515
515
double dbl;
516
516
uint32 luHi, luLo;
@@ -591,6 +591,6 @@ namespace Js
591
591
return dbl;
592
592
}
593
593
594
- template bool BigInt ::FInitFromDigits<char16>(const char16 *prgch, int32 cch, int32 *pcchDig);
595
- template bool BigInt ::FInitFromDigits<utf8char_t >(const utf8char_t *prgch, int32 cch, int32 *pcchDig);
594
+ template bool BigUInt ::FInitFromDigits<char16>(const char16 *prgch, int32 cch, int32 *pcchDig);
595
+ template bool BigUInt ::FInitFromDigits<utf8char_t >(const utf8char_t *prgch, int32 cch, int32 *pcchDig);
596
596
}
0 commit comments