From de150d00ecba04569c86e702a0a74f86a47d3a75 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Wed, 25 Nov 2009 12:57:06 +0000 Subject: [PATCH] added: UInt::operator>>(int) UInt::operator>>=(int) UInt::operator<<(int) UInt::operator<<=(int) git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@250 e52654a7-88a9-db11-a3e9-0013d4bc506e --- CHANGELOG | 4 ++++ ttmath/ttmathuint.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 9d084de..646bf4a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -66,6 +66,10 @@ Version 0.9.0 prerelease (2009.11.24): asm_gcc_64 - with asm for GCC (64 bit) no_asm_32 - pure C++ version (32 bit) - without any asm code no_asm_64 - pure C++ version (64 bit) - without any asm code + * added: UInt::operator>>(int) + UInt::operator>>=(int) + UInt::operator<<(int) + UInt::operator<<=(int) * changed: Factorial() is using the Gamma() function now * changed: Big::Div(ss2) Big::Mod(ss2) diff --git a/ttmath/ttmathuint.h b/ttmath/ttmathuint.h index 88c725e..311e945 100644 --- a/ttmath/ttmathuint.h +++ b/ttmath/ttmathuint.h @@ -3242,7 +3242,40 @@ public: } + UInt operator>>(int move) + { + UInt temp( *this ); + temp.Rcr(move); + + return temp; + } + + + UInt & operator>>=(int move) + { + Rcr(move); + + return *this; + } + + + UInt operator<<(int move) + { + UInt temp( *this ); + + temp.Rcl(move); + + return temp; + } + + + UInt & operator<<=(int move) + { + Rcl(move); + + return *this; + } /*!