#include "Types.h"
Namespaces | |
namespace | big |
Classes | |
class | big::Int |
Defines | |
#define | BIGHIGHBIT(n) ((n)[sizeof(n) / sizeof(big::word) - 1] & WORDHIGHBIT) |
#define | BIGONETYPE template<class T> |
#define | BIGTWOTYPES template<class T, class Bigger> |
#define | BIGSMALLTYPE template<class Smaller> |
#define | BIGWORDCOUNT_FROMBITCOUNT(bits) ((bits) / 8 / sizeof(big::word)) |
#define | BIGWORDCOUNT(T) (sizeof(T) / sizeof(big::word)) |
#define | BIGBITCOUNT(T) (sizeof(T) * 8) |
#define | BIGDOUBLESIZE(T, var_name) big::word (var_name)[BIGWORDCOUNT(T) * 2] |
#define | BIGHALFSIZE(T, var_name) big::word (var_name)[BIGWORDCOUNT(T) / 2] |
#define | BIGINTFAST INLINE Int<T> & |
#define | BIGINTSLOW Int<T> |
Typedefs | |
typedef u32 | big::word |
typedef word | big::u128 [BIGWORDCOUNT_FROMBITCOUNT(128)] |
typedef word | big::u256 [BIGWORDCOUNT_FROMBITCOUNT(256)] |
typedef word | big::u512 [BIGWORDCOUNT_FROMBITCOUNT(512)] |
typedef word | big::u1024 [BIGWORDCOUNT_FROMBITCOUNT(1024)] |
typedef word | big::u2048 [BIGWORDCOUNT_FROMBITCOUNT(2048)] |
typedef word | big::u4096 [BIGWORDCOUNT_FROMBITCOUNT(4096)] |
typedef word | big::u8192 [BIGWORDCOUNT_FROMBITCOUNT(8192)] |
typedef word | big::u16384 [BIGWORDCOUNT_FROMBITCOUNT(16384)] |
typedef word | big::u32768 [BIGWORDCOUNT_FROMBITCOUNT(32768)] |
Functions | |
BIGONETYPE INLINE void | big::zero (T &n) |
BIGONETYPE INLINE void | big::usetw (T &a, word b) |
BIGONETYPE INLINE void | big::ssetw (T &a, word b) |
BIGONETYPE INLINE void | big::set (T &a, T &b) |
BIGTWOTYPES INLINE void | big::usetlow (Bigger &a, T &b) |
BIGTWOTYPES INLINE void | big::ssetlow (Bigger &a, T &b) |
BIGTWOTYPES INLINE void | big::sethigh (Bigger &a, T &b) |
BIGTWOTYPES INLINE void | big::takelow (T &a, Bigger &b) |
BIGTWOTYPES INLINE void | big::takehigh (T &a, Bigger &b) |
BIGONETYPE bool | big::ugreater (T &a, T &b) |
BIGONETYPE bool | big::ugreaterOrEqual (T &a, T &b) |
BIGONETYPE bool | big::sgreater (T &a, T &b) |
BIGONETYPE bool | big::sgreaterOrEqual (T &a, T &b) |
BIGONETYPE INLINE bool | big::equal (T &a, T &b) |
BIGONETYPE INLINE bool | big::isZero (T &n) |
BIGONETYPE void | big::bAND (T &a, T &b) |
BIGONETYPE void | big::bOR (T &a, T &b) |
BIGONETYPE void | big::bXOR (T &a, T &b) |
BIGONETYPE void | big::bNOT (T &n) |
BIGONETYPE void | big::shiftLeft1 (T &n) |
BIGONETYPE void | big::shiftLeft (T &n, u32 s) |
BIGONETYPE void | big::ushiftRight1 (T &n) |
BIGONETYPE void | big::ushiftRight (T &n, u32 s) |
BIGONETYPE void | big::sshiftRight1 (T &n) |
BIGONETYPE void | big::sshiftRight (T &n, u32 s) |
BIGONETYPE void | big::add (T &a, T &b) |
BIGONETYPE void | big::increment (T &n) |
BIGONETYPE void | big::subtract (T &a, T &b) |
BIGONETYPE void | big::decrement (T &n) |
BIGONETYPE void | big::negate (T &n) |
BIGONETYPE void | big::usquare (T &a) |
BIGTWOTYPES void | big::umultiply (T &a, T &b, Bigger &m) |
BIGTWOTYPES void | big::umultiply (Bigger &a, T &b) |
BIGONETYPE void | big::ssquare (T &a) |
BIGTWOTYPES void | big::smultiply (T &a, T &b, Bigger &m) |
BIGTWOTYPES void | big::smultiply (Bigger &a, T &b) |
BIGONETYPE void | big::udivide (T &a, T &b, T &q, T &r) |
BIGONETYPE void | big::umodulo (T &a, T &b, T &r) |
BIGONETYPE void | big::sdivide (T &a, T &b, T &q, T &r) |
BIGONETYPE void | big::smodulo (T &a, T &b, T &r) |
Variables | |
const u32 | big::WORDBITS = sizeof( word ) * 8 |
const u32 | big::HALFWORDBITS = sizeof( word ) * 8 / 2 |
const word | big::WORDHIGHBIT = ( word ) 1 << ( WORDBITS - 1 ) |
const word | big::WORDALLBITS = ( word ) 0 - 1 |
const word | big::WORDLOBITS = ( ( word ) 1 << HALFWORDBITS ) - 1 |
const word | big::WORDHIBITS = WORDALLBITS ^ WORDLOBITS |
This file is part of RakNet Copyright 2003 Kevin Jenkins.
(128)2^7-bit to (32768)2^14-bit signed 2's complement & unsigned extended arithmetic
catid(cat02e@fsu.edu)
7/30/2004 Fixed VS6 compat 7/28/2004 Fixed macros so they can be used outside of the big namespace Now using pre-processor definitions from types.h for inline assembly 7/26/2004 Removed a lot of assembly, made add/sub assembly optional 7/25/2004 Merged the wrapper class Int<T> from older code 7/24/2004 Replaced trivial assembly code with std:: functions Refined some assembly code with Art of Assembly chapter 9 Added binary ops 7/23/2004 Finished assembly coding Removed Int<T> class, for now Added old C++ code back in with USEASSEMBLY 7/22/2004 Signed arithmetic (needed for ext. Euclidean algo) Cleaned up coding style Began rewriting parts in assembly 7/21/2004 Began writing
Tabs: 4 spaces Dist: public