diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/big_base.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/big_base.cpp b/src/big_base.cpp index 158d967fb..a6d9e3e9e 100644 --- a/src/big_base.cpp +++ b/src/big_base.cpp @@ -338,6 +338,23 @@ BigInt BigInt::operator-() const } /************************************************* +* Return a reference to the indexed word * +*************************************************/ +word& BigInt::operator[](u32bit index) + { + reg.grow_to(index+1); + return reg[index]; + } + +/************************************************* +* Return the value of the indexed word * +*************************************************/ +word BigInt::operator[](u32bit index) const + { + return (index < size()) ? reg[index] : 0; + } + +/************************************************* * Return the absolute value of this number * *************************************************/ BigInt BigInt::abs() const |