// ============================================================ // // traitsD.h // // Copyright 2002, Dennis Meilicke and Rene Peralta // // ============================================================ // // Description: // // Declaration of the traits class. // // ============================================================ #ifndef __nttl_traitsD__ #define __nttl_traitsD__ #include // for size_t, etc. // // This shouldn't be here. Where should the bool type go? // #ifdef _AIX #include #endif template< class T > class nttlTraits { public: T Random( size_t digits ); T RandomMod( T m ); T Square( const T& x ); short Mod8( const T& x ); short Mod4( const T& x ); bool IsOdd( const T &x ); bool IsEven( const T &x ); T Abs( const T &X ); T Power( T X, T e ); T Power( T X, T e, const T &m ); size_t DecimalDigits( const T& x ); short ToShort( const T& X ); long ToLong( const T& X ); unsigned short ToUnsignedShort( const T& X ); unsigned long ToUnsignedLong( const T& X ); }; #endif // __nttl_traitsD__