Logo Search packages:      
Sourcecode: abakus version File versions  Download package

Abakus::number< T > Class Template Reference

#include <numerictypes.h>

List of all members.


Detailed Description

template<typename T>
class Abakus::number< T >

Representation of a number type. Includes the basic operators, along with built-in functions such as abs() and mod().

You need to actually define it using template specializations though. You can add functions in a specialization, it may be worth it to have the functions declared here as well so that you get a compiler error if you forget to implement it.

Note that since we're using a specialization, and then typedef'ing the new specialized class to number_t, that means we only support one type of number at a time, and the choice is made at compile-time.

Definition at line 62 of file numerictypes.h.


Public Member Functions

number< T > abs () const
number< T > acos () const
number< T > acosh () const
double asDouble () const
number< T > asin () const
number< T > asinh () const
number< T > atan () const
number< T > atanh () const
number< T > ceil () const
number< T > cos () const
number< T > cosh () const
number< T > exp () const
number< T > floor () const
number< T > frac () const
number< T > integer () const
number< T > ln () const
number< T > log () const
 number (int i)
 Convienience constructor to create a number from an integer.
 number (const char *str)
 number (const number &other)
 Copy constructor.
 number (const T &t=T())
 Default ctor and set-and-assign ctor wrapped in one.
bool operator!= (const number< T > &other) const
number< T > operator- () const
bool operator< (const number< T > &other) const
bool operator<= (const number< T > &other) const
number< T > & operator= (const number< T > &other)
 Assignment operator. Be sure to check for &other == this if necessary!
bool operator== (const number< T > &other) const
bool operator> (const number< T > &other) const
bool operator>= (const number< T > &other) const
number< T > pow (const number< T > &exponent)
number< T > round () const
number< T > sin () const
number< T > sinh () const
number< T > sqrt () const
number< T > tan () const
number< T > tanh () const
QString toString () const
value () const

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index