Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Related Functions | List of all members
vnl_decnum Class Reference

#include <vnl_decnum.h>

Public Member Functions

std::string data () const
 
char sign () const
 
long exp () const
 
 vnl_decnum ()
 Default constructor - creates the number zero. More...
 
 vnl_decnum (vnl_decnum const &r)=default
 
 vnl_decnum (std::string const &)
 Constructor from string. More...
 
 vnl_decnum (char const *r)
 
 vnl_decnum (unsigned long)
 Creates a vnl_decnum from an unsigned long integer. More...
 
 vnl_decnum (long r)
 Creates a vnl_decnum from a long integer. More...
 
 vnl_decnum (unsigned int r)
 Creates a vnl_decnum from an unsigned integer. More...
 
 vnl_decnum (int r)
 Creates a vnl_decnum from an integer. More...
 
 vnl_decnum (double)
 Creates a vnl_decnum from a double. More...
 
 ~vnl_decnum ()=default
 
 operator std::string () const
 Implicit type conversion to a decimal string. More...
 
 operator long () const
 
 operator unsigned long () const
 
 operator int () const
 
 operator unsigned int () const
 
vnl_decnum operator+ () const
 Unary plus operator. More...
 
vnl_decnum operator- () const
 Unary minus operator. More...
 
vnl_decnum operator<< (long int r) const
 Left "bit" shift operator (actually: digit shift, or exponent translation). More...
 
vnl_decnum operator<< (int r) const
 
vnl_decnum operator>> (long int r) const
 Right "bit" shift operator (actually: digit shift, or exponent translation). More...
 
vnl_decnum operator>> (int r) const
 
vnl_decnumoperator<<= (long int r)
 Left "bit" shift operator (actually: digit shift, or exponent translation). More...
 
vnl_decnumoperator<<= (int r)
 
vnl_decnumoperator>>= (long int r)
 Right "bit" shift operator (actually: digit shift, or exponent translation). More...
 
vnl_decnumoperator>>= (int r)
 
vnl_decnumcompactify ()
 Remove all trailing zeros from the mantissa, and increase the exponent accordingly. More...
 
vnl_decnumexpand ()
 Expand integers to their non-compactified representation, i.e., without "e" notation. More...
 
vnl_decnumoperator= (const vnl_decnum &r)
 Assignment operator; no compactification or expansion occurs. More...
 
vnl_decnum operator+ (vnl_decnum const &r) const
 Sum. More...
 
vnl_decnum operator- (vnl_decnum const &r) const
 Difference. More...
 
vnl_decnum operator * (vnl_decnum const &r) const
 Product. More...
 
vnl_decnum operator/ (vnl_decnum const &r) const
 division operator. More...
 
vnl_decnum operator% (vnl_decnum const &r) const
 modulo operator. More...
 
vnl_decnumoperator+= (vnl_decnum const &r)
 
vnl_decnumoperator-= (vnl_decnum const &r)
 
vnl_decnumoperator *= (vnl_decnum const &r)
 
vnl_decnumoperator/= (vnl_decnum const &r)
 
vnl_decnumoperator%= (vnl_decnum const &r)
 
vnl_decnumoperator= (std::string const &r)
 
vnl_decnumoperator= (char const *r)
 
vnl_decnumoperator= (unsigned long r)
 
vnl_decnumoperator= (long r)
 
vnl_decnumoperator= (unsigned int r)
 
vnl_decnumoperator= (int r)
 
vnl_decnumoperator= (double r)
 
vnl_decnum operator+ (std::string const &r) const
 
vnl_decnum operator+ (char const *r) const
 
vnl_decnum operator+ (unsigned long r) const
 
vnl_decnum operator+ (long r) const
 
vnl_decnum operator+ (unsigned int r) const
 
vnl_decnum operator+ (int r) const
 
vnl_decnum operator+ (double r) const
 
vnl_decnum operator- (std::string const &r) const
 
vnl_decnum operator- (char const *r) const
 
vnl_decnum operator- (unsigned long r) const
 
vnl_decnum operator- (long r) const
 
vnl_decnum operator- (unsigned int r) const
 
vnl_decnum operator- (int r) const
 
vnl_decnum operator- (double r) const
 
vnl_decnum operator * (std::string const &r) const
 
vnl_decnum operator * (char const *r) const
 
vnl_decnum operator * (unsigned long r) const
 
vnl_decnum operator * (long r) const
 
vnl_decnum operator * (unsigned int r) const
 
vnl_decnum operator * (int r) const
 
vnl_decnum operator * (double r) const
 
vnl_decnum operator/ (std::string const &r) const
 
vnl_decnum operator/ (char const *r) const
 
vnl_decnum operator/ (unsigned long r) const
 
vnl_decnum operator/ (long r) const
 
vnl_decnum operator/ (unsigned int r) const
 
vnl_decnum operator/ (int r) const
 
vnl_decnum operator/ (double r) const
 
vnl_decnum operator% (std::string const &r) const
 
vnl_decnum operator% (char const *r) const
 
vnl_decnum operator% (unsigned long r) const
 
vnl_decnum operator% (long r) const
 
vnl_decnum operator% (unsigned int r) const
 
vnl_decnum operator% (int r) const
 
vnl_decnum operator% (double r) const
 
vnl_decnumoperator+= (std::string const &r)
 
vnl_decnumoperator-= (std::string const &r)
 
vnl_decnumoperator *= (std::string const &r)
 
vnl_decnumoperator/= (std::string const &r)
 
vnl_decnumoperator%= (std::string const &r)
 
vnl_decnumoperator+= (char const *r)
 
vnl_decnumoperator-= (char const *r)
 
vnl_decnumoperator *= (char const *r)
 
vnl_decnumoperator/= (char const *r)
 
vnl_decnumoperator%= (char const *r)
 
vnl_decnumoperator+= (unsigned long r)
 
vnl_decnumoperator-= (unsigned long r)
 
vnl_decnumoperator *= (unsigned long r)
 
vnl_decnumoperator/= (unsigned long r)
 
vnl_decnumoperator%= (unsigned long r)
 
vnl_decnumoperator+= (long r)
 
vnl_decnumoperator-= (long r)
 
vnl_decnumoperator *= (long r)
 
vnl_decnumoperator/= (long r)
 
vnl_decnumoperator%= (long r)
 
vnl_decnumoperator+= (unsigned int r)
 
vnl_decnumoperator-= (unsigned int r)
 
vnl_decnumoperator *= (unsigned int r)
 
vnl_decnumoperator/= (unsigned int r)
 
vnl_decnumoperator%= (unsigned int r)
 
vnl_decnumoperator+= (int r)
 
vnl_decnumoperator-= (int r)
 
vnl_decnumoperator *= (int r)
 
vnl_decnumoperator/= (int r)
 
vnl_decnumoperator%= (int r)
 
vnl_decnumoperator+= (double r)
 
vnl_decnumoperator-= (double r)
 
vnl_decnumoperator *= (double r)
 
vnl_decnumoperator/= (double r)
 
vnl_decnumoperator%= (double r)
 
vnl_decnumoperator++ ()
 prefix increment (++b). More...
 
vnl_decnumoperator-- ()
 decrement. More...
 
vnl_decnum operator++ (int)
 postfix increment (b++). More...
 
vnl_decnum operator-- (int)
 decrement. More...
 
bool operator== (vnl_decnum const &) const
 
bool operator< (vnl_decnum const &) const
 
bool operator!= (vnl_decnum const &r) const
 
bool operator> (vnl_decnum const &r) const
 
bool operator<= (vnl_decnum const &r) const
 
bool operator>= (vnl_decnum const &r) const
 
bool operator== (std::string const &r) const
 
bool operator< (std::string const &r) const
 
bool operator!= (std::string const &r) const
 
bool operator> (std::string const &r) const
 
bool operator<= (std::string const &r) const
 
bool operator>= (std::string const &r) const
 
bool operator== (char const *r) const
 
bool operator< (char const *r) const
 
bool operator!= (char const *r) const
 
bool operator> (char const *r) const
 
bool operator<= (char const *r) const
 
bool operator>= (char const *r) const
 
bool operator== (unsigned long r) const
 
bool operator< (unsigned long r) const
 
bool operator!= (unsigned long r) const
 
bool operator> (unsigned long r) const
 
bool operator<= (unsigned long r) const
 
bool operator>= (unsigned long r) const
 
bool operator== (long r) const
 
bool operator< (long r) const
 
bool operator!= (long r) const
 
bool operator> (long r) const
 
bool operator<= (long r) const
 
bool operator>= (long r) const
 
bool operator== (unsigned int r) const
 
bool operator< (unsigned int r) const
 
bool operator!= (unsigned int r) const
 
bool operator> (unsigned int r) const
 
bool operator<= (unsigned int r) const
 
bool operator>= (unsigned int r) const
 
bool operator== (int r) const
 
bool operator< (int r) const
 
bool operator!= (int r) const
 
bool operator> (int r) const
 
bool operator<= (int r) const
 
bool operator>= (int r) const
 
bool operator== (double r) const
 
bool operator< (double r) const
 
bool operator!= (double r) const
 
bool operator> (double r) const
 
bool operator<= (double r) const
 
bool operator>= (double r) const
 
vnl_decnum abs () const
 
vnl_decnum trunc () const
 
vnl_decnum roundup () const
 
vnl_decnum floor () const
 
vnl_decnum ceil () const
 
vnl_decnum pow (unsigned long p) const
 

Private Member Functions

 vnl_decnum (char s, std::string d, long e)
 

Static Private Member Functions

static vnl_decnum plus (std::string const &, std::string const &, long)
 Returns the sum of the two first arguments (interpreted as mantissas with the same exponent). More...
 
static vnl_decnum minus (std::string const &, std::string const &, long)
 Returns the difference of the two first arguments (interpreted as mantissas with the same exponent). More...
 
static bool comp (std::string const &, std::string const &)
 This is "operator<" for strings. More...
 
static std::string add_zeros (std::string const &source, unsigned long n)
 
static std::string mult (std::string const &, char)
 Returns the product of the two arguments. More...
 
static std::string div (std::string const &, std::string &)
 Returns the largest one-significant-digit divisor of the two arguments. More...
 

Private Attributes

char sign_
 
std::string data_
 
long exp_
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &s, vnl_decnum const &r)
 decimal output. More...
 
VNL_EXPORT std::istream & operator>> (std::istream &s, vnl_decnum &r)
 decimal input. More...
 

Detailed Description

Definition at line 85 of file vnl_decnum.h.

Constructor & Destructor Documentation

◆ vnl_decnum() [1/10]

vnl_decnum::vnl_decnum ( char  s,
std::string  d,
long  e 
)
inlineprivate

Definition at line 96 of file vnl_decnum.h.

◆ vnl_decnum() [2/10]

vnl_decnum::vnl_decnum ( )
inline

Default constructor - creates the number zero.

Definition at line 102 of file vnl_decnum.h.

◆ vnl_decnum() [3/10]

vnl_decnum::vnl_decnum ( vnl_decnum const &  r)
default

◆ vnl_decnum() [4/10]

vnl_decnum::vnl_decnum ( std::string const &  r)

Constructor from string.

This is the principal constructor for vnl_decnum; it essentially parses the input into (in that order) the sign, the mantissa, and the exponent, which turn out (surprise!) to be the three data members of this class. Parsing stops at the first unexpected character, so in the worst case no characters can be used and the decnum is zero.

Definition at line 15 of file vnl_decnum.cxx.

◆ vnl_decnum() [5/10]

vnl_decnum::vnl_decnum ( char const *  r)
inline

Definition at line 112 of file vnl_decnum.h.

◆ vnl_decnum() [6/10]

vnl_decnum::vnl_decnum ( unsigned long  r)
explicit

Creates a vnl_decnum from an unsigned long integer.

Definition at line 51 of file vnl_decnum.cxx.

◆ vnl_decnum() [7/10]

vnl_decnum::vnl_decnum ( long  r)
inlineexplicit

Creates a vnl_decnum from a long integer.

Uses the "unsigned long" constructor and additionally sets the sign

Definition at line 117 of file vnl_decnum.h.

◆ vnl_decnum() [8/10]

vnl_decnum::vnl_decnum ( unsigned int  r)
inlineexplicit

Creates a vnl_decnum from an unsigned integer.

Uses the "unsigned long" constructor.

Definition at line 122 of file vnl_decnum.h.

◆ vnl_decnum() [9/10]

vnl_decnum::vnl_decnum ( int  r)
inlineexplicit

Creates a vnl_decnum from an integer.

Uses the "unsigned long" constructor and additionally sets the sign

Definition at line 127 of file vnl_decnum.h.

◆ vnl_decnum() [10/10]

vnl_decnum::vnl_decnum ( double  r)

Creates a vnl_decnum from a double.

No guarantees on the precise result! Integers will be correctly converted, though.

Definition at line 61 of file vnl_decnum.cxx.

◆ ~vnl_decnum()

vnl_decnum::~vnl_decnum ( )
default

Member Function Documentation

◆ abs()

vnl_decnum vnl_decnum::abs ( ) const
inline

Definition at line 354 of file vnl_decnum.h.

◆ add_zeros()

static std::string vnl_decnum::add_zeros ( std::string const &  source,
unsigned long  n 
)
inlinestaticprivate

Definition at line 376 of file vnl_decnum.h.

◆ ceil()

vnl_decnum vnl_decnum::ceil ( ) const
inline

Definition at line 358 of file vnl_decnum.h.

◆ comp()

bool vnl_decnum::comp ( std::string const &  a,
std::string const &  b 
)
staticprivate

This is "operator<" for strings.

The arguments should consist of digits only (interpreted as mantissas with the same exponent). The shorter of the two arguments is implicitly zero-padded.

Definition at line 146 of file vnl_decnum.cxx.

◆ compactify()

vnl_decnum & vnl_decnum::compactify ( )

Remove all trailing zeros from the mantissa, and increase the exponent accordingly.

Return the (thus modified) *this. This effectively compactifies the data representation of *this, and meanwhile increases the exponent. No other methods have this effect; to the contrary: e.g. operator+(1) often decreases the exponent to 0.

Definition at line 441 of file vnl_decnum.cxx.

◆ data()

std::string vnl_decnum::data ( ) const
inline

Definition at line 98 of file vnl_decnum.h.

◆ div()

std::string vnl_decnum::div ( std::string const &  a,
std::string &  b 
)
staticprivate

Returns the largest one-significant-digit divisor of the two arguments.

The largest multiple of the second argument not larger than the first one is returned in the second argument. (I.e.: the product of the original second argument with the returned divisor.) The arguments should consist of digits only and the first one should be numerically larger than the second one.

Definition at line 321 of file vnl_decnum.cxx.

◆ exp()

long vnl_decnum::exp ( ) const
inline

Definition at line 100 of file vnl_decnum.h.

◆ expand()

vnl_decnum& vnl_decnum::expand ( )
inline

Expand integers to their non-compactified representation, i.e., without "e" notation.

Other operators (like + or -) might implicitly have this effect, as the implementation here indeed suggests.

Definition at line 171 of file vnl_decnum.h.

◆ floor()

vnl_decnum vnl_decnum::floor ( ) const
inline

Definition at line 357 of file vnl_decnum.h.

◆ minus()

vnl_decnum vnl_decnum::minus ( std::string const &  a,
std::string const &  b,
long  exp 
)
staticprivate

Returns the difference of the two first arguments (interpreted as mantissas with the same exponent).

Both arguments should consist of digits only and the first one should be numerically larger than the second one. The third argument will be used as the exponent of the result.

Definition at line 217 of file vnl_decnum.cxx.

◆ mult()

std::string vnl_decnum::mult ( std::string const &  a,
char  b 
)
staticprivate

Returns the product of the two arguments.

The first argument should consist of digits only; the second argument should be a single digit.

Definition at line 271 of file vnl_decnum.cxx.

◆ operator *() [1/8]

vnl_decnum vnl_decnum::operator * ( vnl_decnum const &  r) const

Product.

Definition at line 289 of file vnl_decnum.cxx.

◆ operator *() [2/8]

vnl_decnum vnl_decnum::operator * ( std::string const &  r) const
inline

Definition at line 223 of file vnl_decnum.h.

◆ operator *() [3/8]

vnl_decnum vnl_decnum::operator * ( char const *  r) const
inline

Definition at line 224 of file vnl_decnum.h.

◆ operator *() [4/8]

vnl_decnum vnl_decnum::operator * ( unsigned long  r) const
inline

Definition at line 225 of file vnl_decnum.h.

◆ operator *() [5/8]

vnl_decnum vnl_decnum::operator * ( long  r) const
inline

Definition at line 226 of file vnl_decnum.h.

◆ operator *() [6/8]

vnl_decnum vnl_decnum::operator * ( unsigned int  r) const
inline

Definition at line 227 of file vnl_decnum.h.

◆ operator *() [7/8]

vnl_decnum vnl_decnum::operator * ( int  r) const
inline

Definition at line 228 of file vnl_decnum.h.

◆ operator *() [8/8]

vnl_decnum vnl_decnum::operator * ( double  r) const
inline

Definition at line 229 of file vnl_decnum.h.

◆ operator *=() [1/8]

vnl_decnum& vnl_decnum::operator *= ( vnl_decnum const &  r)
inline

Definition at line 193 of file vnl_decnum.h.

◆ operator *=() [2/8]

vnl_decnum& vnl_decnum::operator *= ( std::string const &  r)
inline

Definition at line 249 of file vnl_decnum.h.

◆ operator *=() [3/8]

vnl_decnum& vnl_decnum::operator *= ( char const *  r)
inline

Definition at line 255 of file vnl_decnum.h.

◆ operator *=() [4/8]

vnl_decnum& vnl_decnum::operator *= ( unsigned long  r)
inline

Definition at line 261 of file vnl_decnum.h.

◆ operator *=() [5/8]

vnl_decnum& vnl_decnum::operator *= ( long  r)
inline

Definition at line 267 of file vnl_decnum.h.

◆ operator *=() [6/8]

vnl_decnum& vnl_decnum::operator *= ( unsigned int  r)
inline

Definition at line 273 of file vnl_decnum.h.

◆ operator *=() [7/8]

vnl_decnum& vnl_decnum::operator *= ( int  r)
inline

Definition at line 279 of file vnl_decnum.h.

◆ operator *=() [8/8]

vnl_decnum& vnl_decnum::operator *= ( double  r)
inline

Definition at line 285 of file vnl_decnum.h.

◆ operator int()

vnl_decnum::operator int ( ) const

Definition at line 114 of file vnl_decnum.cxx.

◆ operator long()

vnl_decnum::operator long ( ) const

Definition at line 95 of file vnl_decnum.cxx.

◆ operator std::string()

vnl_decnum::operator std::string ( ) const

Implicit type conversion to a decimal string.

Definition at line 72 of file vnl_decnum.cxx.

◆ operator unsigned int()

vnl_decnum::operator unsigned int ( ) const

Definition at line 105 of file vnl_decnum.cxx.

◆ operator unsigned long()

vnl_decnum::operator unsigned long ( ) const

Definition at line 86 of file vnl_decnum.cxx.

◆ operator!=() [1/8]

bool vnl_decnum::operator!= ( vnl_decnum const &  r) const
inline

Definition at line 300 of file vnl_decnum.h.

◆ operator!=() [2/8]

bool vnl_decnum::operator!= ( std::string const &  r) const
inline

Definition at line 307 of file vnl_decnum.h.

◆ operator!=() [3/8]

bool vnl_decnum::operator!= ( char const *  r) const
inline

Definition at line 314 of file vnl_decnum.h.

◆ operator!=() [4/8]

bool vnl_decnum::operator!= ( unsigned long  r) const
inline

Definition at line 321 of file vnl_decnum.h.

◆ operator!=() [5/8]

bool vnl_decnum::operator!= ( long  r) const
inline

Definition at line 328 of file vnl_decnum.h.

◆ operator!=() [6/8]

bool vnl_decnum::operator!= ( unsigned int  r) const
inline

Definition at line 335 of file vnl_decnum.h.

◆ operator!=() [7/8]

bool vnl_decnum::operator!= ( int  r) const
inline

Definition at line 342 of file vnl_decnum.h.

◆ operator!=() [8/8]

bool vnl_decnum::operator!= ( double  r) const
inline

Definition at line 349 of file vnl_decnum.h.

◆ operator%() [1/8]

vnl_decnum vnl_decnum::operator% ( vnl_decnum const &  r) const

modulo operator.

Returns
remainder of long division of *this with r When r is zero, the result equals *this.

Definition at line 380 of file vnl_decnum.cxx.

◆ operator%() [2/8]

vnl_decnum vnl_decnum::operator% ( std::string const &  r) const
inline

Definition at line 239 of file vnl_decnum.h.

◆ operator%() [3/8]

vnl_decnum vnl_decnum::operator% ( char const *  r) const
inline

Definition at line 240 of file vnl_decnum.h.

◆ operator%() [4/8]

vnl_decnum vnl_decnum::operator% ( unsigned long  r) const
inline

Definition at line 241 of file vnl_decnum.h.

◆ operator%() [5/8]

vnl_decnum vnl_decnum::operator% ( long  r) const
inline

Definition at line 242 of file vnl_decnum.h.

◆ operator%() [6/8]

vnl_decnum vnl_decnum::operator% ( unsigned int  r) const
inline

Definition at line 243 of file vnl_decnum.h.

◆ operator%() [7/8]

vnl_decnum vnl_decnum::operator% ( int  r) const
inline

Definition at line 244 of file vnl_decnum.h.

◆ operator%() [8/8]

vnl_decnum vnl_decnum::operator% ( double  r) const
inline

Definition at line 245 of file vnl_decnum.h.

◆ operator%=() [1/8]

vnl_decnum& vnl_decnum::operator%= ( vnl_decnum const &  r)
inline

Definition at line 195 of file vnl_decnum.h.

◆ operator%=() [2/8]

vnl_decnum& vnl_decnum::operator%= ( std::string const &  r)
inline

Definition at line 251 of file vnl_decnum.h.

◆ operator%=() [3/8]

vnl_decnum& vnl_decnum::operator%= ( char const *  r)
inline

Definition at line 257 of file vnl_decnum.h.

◆ operator%=() [4/8]

vnl_decnum& vnl_decnum::operator%= ( unsigned long  r)
inline

Definition at line 263 of file vnl_decnum.h.

◆ operator%=() [5/8]

vnl_decnum& vnl_decnum::operator%= ( long  r)
inline

Definition at line 269 of file vnl_decnum.h.

◆ operator%=() [6/8]

vnl_decnum& vnl_decnum::operator%= ( unsigned int  r)
inline

Definition at line 275 of file vnl_decnum.h.

◆ operator%=() [7/8]

vnl_decnum& vnl_decnum::operator%= ( int  r)
inline

Definition at line 281 of file vnl_decnum.h.

◆ operator%=() [8/8]

vnl_decnum& vnl_decnum::operator%= ( double  r)
inline

Definition at line 287 of file vnl_decnum.h.

◆ operator+() [1/9]

vnl_decnum vnl_decnum::operator+ ( ) const
inline

Unary plus operator.

Definition at line 146 of file vnl_decnum.h.

◆ operator+() [2/9]

vnl_decnum vnl_decnum::operator+ ( vnl_decnum const &  r) const

Sum.

Definition at line 241 of file vnl_decnum.cxx.

◆ operator+() [3/9]

vnl_decnum vnl_decnum::operator+ ( std::string const &  r) const
inline

Definition at line 207 of file vnl_decnum.h.

◆ operator+() [4/9]

vnl_decnum vnl_decnum::operator+ ( char const *  r) const
inline

Definition at line 208 of file vnl_decnum.h.

◆ operator+() [5/9]

vnl_decnum vnl_decnum::operator+ ( unsigned long  r) const
inline

Definition at line 209 of file vnl_decnum.h.

◆ operator+() [6/9]

vnl_decnum vnl_decnum::operator+ ( long  r) const
inline

Definition at line 210 of file vnl_decnum.h.

◆ operator+() [7/9]

vnl_decnum vnl_decnum::operator+ ( unsigned int  r) const
inline

Definition at line 211 of file vnl_decnum.h.

◆ operator+() [8/9]

vnl_decnum vnl_decnum::operator+ ( int  r) const
inline

Definition at line 212 of file vnl_decnum.h.

◆ operator+() [9/9]

vnl_decnum vnl_decnum::operator+ ( double  r) const
inline

Definition at line 213 of file vnl_decnum.h.

◆ operator++() [1/2]

vnl_decnum& vnl_decnum::operator++ ( )
inline

prefix increment (++b).

Definition at line 290 of file vnl_decnum.h.

◆ operator++() [2/2]

vnl_decnum vnl_decnum::operator++ ( int  )
inline

postfix increment (b++).

Definition at line 294 of file vnl_decnum.h.

◆ operator+=() [1/8]

vnl_decnum& vnl_decnum::operator+= ( vnl_decnum const &  r)
inline

Definition at line 191 of file vnl_decnum.h.

◆ operator+=() [2/8]

vnl_decnum& vnl_decnum::operator+= ( std::string const &  r)
inline

Definition at line 247 of file vnl_decnum.h.

◆ operator+=() [3/8]

vnl_decnum& vnl_decnum::operator+= ( char const *  r)
inline

Definition at line 253 of file vnl_decnum.h.

◆ operator+=() [4/8]

vnl_decnum& vnl_decnum::operator+= ( unsigned long  r)
inline

Definition at line 259 of file vnl_decnum.h.

◆ operator+=() [5/8]

vnl_decnum& vnl_decnum::operator+= ( long  r)
inline

Definition at line 265 of file vnl_decnum.h.

◆ operator+=() [6/8]

vnl_decnum& vnl_decnum::operator+= ( unsigned int  r)
inline

Definition at line 271 of file vnl_decnum.h.

◆ operator+=() [7/8]

vnl_decnum& vnl_decnum::operator+= ( int  r)
inline

Definition at line 277 of file vnl_decnum.h.

◆ operator+=() [8/8]

vnl_decnum& vnl_decnum::operator+= ( double  r)
inline

Definition at line 283 of file vnl_decnum.h.

◆ operator-() [1/9]

vnl_decnum vnl_decnum::operator- ( ) const
inline

Unary minus operator.

Definition at line 148 of file vnl_decnum.h.

◆ operator-() [2/9]

vnl_decnum vnl_decnum::operator- ( vnl_decnum const &  r) const
inline

Difference.

Definition at line 178 of file vnl_decnum.h.

◆ operator-() [3/9]

vnl_decnum vnl_decnum::operator- ( std::string const &  r) const
inline

Definition at line 215 of file vnl_decnum.h.

◆ operator-() [4/9]

vnl_decnum vnl_decnum::operator- ( char const *  r) const
inline

Definition at line 216 of file vnl_decnum.h.

◆ operator-() [5/9]

vnl_decnum vnl_decnum::operator- ( unsigned long  r) const
inline

Definition at line 217 of file vnl_decnum.h.

◆ operator-() [6/9]

vnl_decnum vnl_decnum::operator- ( long  r) const
inline

Definition at line 218 of file vnl_decnum.h.

◆ operator-() [7/9]

vnl_decnum vnl_decnum::operator- ( unsigned int  r) const
inline

Definition at line 219 of file vnl_decnum.h.

◆ operator-() [8/9]

vnl_decnum vnl_decnum::operator- ( int  r) const
inline

Definition at line 220 of file vnl_decnum.h.

◆ operator-() [9/9]

vnl_decnum vnl_decnum::operator- ( double  r) const
inline

Definition at line 221 of file vnl_decnum.h.

◆ operator--() [1/2]

vnl_decnum& vnl_decnum::operator-- ( )
inline

decrement.

Definition at line 292 of file vnl_decnum.h.

◆ operator--() [2/2]

vnl_decnum vnl_decnum::operator-- ( int  )
inline

decrement.

Definition at line 296 of file vnl_decnum.h.

◆ operator-=() [1/8]

vnl_decnum& vnl_decnum::operator-= ( vnl_decnum const &  r)
inline

Definition at line 192 of file vnl_decnum.h.

◆ operator-=() [2/8]

vnl_decnum& vnl_decnum::operator-= ( std::string const &  r)
inline

Definition at line 248 of file vnl_decnum.h.

◆ operator-=() [3/8]

vnl_decnum& vnl_decnum::operator-= ( char const *  r)
inline

Definition at line 254 of file vnl_decnum.h.

◆ operator-=() [4/8]

vnl_decnum& vnl_decnum::operator-= ( unsigned long  r)
inline

Definition at line 260 of file vnl_decnum.h.

◆ operator-=() [5/8]

vnl_decnum& vnl_decnum::operator-= ( long  r)
inline

Definition at line 266 of file vnl_decnum.h.

◆ operator-=() [6/8]

vnl_decnum& vnl_decnum::operator-= ( unsigned int  r)
inline

Definition at line 272 of file vnl_decnum.h.

◆ operator-=() [7/8]

vnl_decnum& vnl_decnum::operator-= ( int  r)
inline

Definition at line 278 of file vnl_decnum.h.

◆ operator-=() [8/8]

vnl_decnum& vnl_decnum::operator-= ( double  r)
inline

Definition at line 284 of file vnl_decnum.h.

◆ operator/() [1/8]

vnl_decnum vnl_decnum::operator/ ( vnl_decnum const &  r) const

division operator.

Returns
integral part of quotient (long division) of *this with r When r is zero, the result is Inf, unless also *this is zero, in which case the result is NaN.

Definition at line 341 of file vnl_decnum.cxx.

◆ operator/() [2/8]

vnl_decnum vnl_decnum::operator/ ( std::string const &  r) const
inline

Definition at line 231 of file vnl_decnum.h.

◆ operator/() [3/8]

vnl_decnum vnl_decnum::operator/ ( char const *  r) const
inline

Definition at line 232 of file vnl_decnum.h.

◆ operator/() [4/8]

vnl_decnum vnl_decnum::operator/ ( unsigned long  r) const
inline

Definition at line 233 of file vnl_decnum.h.

◆ operator/() [5/8]

vnl_decnum vnl_decnum::operator/ ( long  r) const
inline

Definition at line 234 of file vnl_decnum.h.

◆ operator/() [6/8]

vnl_decnum vnl_decnum::operator/ ( unsigned int  r) const
inline

Definition at line 235 of file vnl_decnum.h.

◆ operator/() [7/8]

vnl_decnum vnl_decnum::operator/ ( int  r) const
inline

Definition at line 236 of file vnl_decnum.h.

◆ operator/() [8/8]

vnl_decnum vnl_decnum::operator/ ( double  r) const
inline

Definition at line 237 of file vnl_decnum.h.

◆ operator/=() [1/8]

vnl_decnum& vnl_decnum::operator/= ( vnl_decnum const &  r)
inline

Definition at line 194 of file vnl_decnum.h.

◆ operator/=() [2/8]

vnl_decnum& vnl_decnum::operator/= ( std::string const &  r)
inline

Definition at line 250 of file vnl_decnum.h.

◆ operator/=() [3/8]

vnl_decnum& vnl_decnum::operator/= ( char const *  r)
inline

Definition at line 256 of file vnl_decnum.h.

◆ operator/=() [4/8]

vnl_decnum& vnl_decnum::operator/= ( unsigned long  r)
inline

Definition at line 262 of file vnl_decnum.h.

◆ operator/=() [5/8]

vnl_decnum& vnl_decnum::operator/= ( long  r)
inline

Definition at line 268 of file vnl_decnum.h.

◆ operator/=() [6/8]

vnl_decnum& vnl_decnum::operator/= ( unsigned int  r)
inline

Definition at line 274 of file vnl_decnum.h.

◆ operator/=() [7/8]

vnl_decnum& vnl_decnum::operator/= ( int  r)
inline

Definition at line 280 of file vnl_decnum.h.

◆ operator/=() [8/8]

vnl_decnum& vnl_decnum::operator/= ( double  r)
inline

Definition at line 286 of file vnl_decnum.h.

◆ operator<() [1/8]

bool vnl_decnum::operator< ( vnl_decnum const &  r) const

Definition at line 162 of file vnl_decnum.cxx.

◆ operator<() [2/8]

bool vnl_decnum::operator< ( std::string const &  r) const
inline

Definition at line 306 of file vnl_decnum.h.

◆ operator<() [3/8]

bool vnl_decnum::operator< ( char const *  r) const
inline

Definition at line 313 of file vnl_decnum.h.

◆ operator<() [4/8]

bool vnl_decnum::operator< ( unsigned long  r) const
inline

Definition at line 320 of file vnl_decnum.h.

◆ operator<() [5/8]

bool vnl_decnum::operator< ( long  r) const
inline

Definition at line 327 of file vnl_decnum.h.

◆ operator<() [6/8]

bool vnl_decnum::operator< ( unsigned int  r) const
inline

Definition at line 334 of file vnl_decnum.h.

◆ operator<() [7/8]

bool vnl_decnum::operator< ( int  r) const
inline

Definition at line 341 of file vnl_decnum.h.

◆ operator<() [8/8]

bool vnl_decnum::operator< ( double  r) const
inline

Definition at line 348 of file vnl_decnum.h.

◆ operator<<() [1/2]

vnl_decnum vnl_decnum::operator<< ( long int  r) const
inline

Left "bit" shift operator (actually: digit shift, or exponent translation).

Definition at line 151 of file vnl_decnum.h.

◆ operator<<() [2/2]

vnl_decnum vnl_decnum::operator<< ( int  r) const
inline

Definition at line 152 of file vnl_decnum.h.

◆ operator<<=() [1/2]

vnl_decnum& vnl_decnum::operator<<= ( long int  r)
inline

Left "bit" shift operator (actually: digit shift, or exponent translation).

Definition at line 157 of file vnl_decnum.h.

◆ operator<<=() [2/2]

vnl_decnum& vnl_decnum::operator<<= ( int  r)
inline

Definition at line 158 of file vnl_decnum.h.

◆ operator<=() [1/8]

bool vnl_decnum::operator<= ( vnl_decnum const &  r) const
inline

Definition at line 302 of file vnl_decnum.h.

◆ operator<=() [2/8]

bool vnl_decnum::operator<= ( std::string const &  r) const
inline

Definition at line 309 of file vnl_decnum.h.

◆ operator<=() [3/8]

bool vnl_decnum::operator<= ( char const *  r) const
inline

Definition at line 316 of file vnl_decnum.h.

◆ operator<=() [4/8]

bool vnl_decnum::operator<= ( unsigned long  r) const
inline

Definition at line 323 of file vnl_decnum.h.

◆ operator<=() [5/8]

bool vnl_decnum::operator<= ( long  r) const
inline

Definition at line 330 of file vnl_decnum.h.

◆ operator<=() [6/8]

bool vnl_decnum::operator<= ( unsigned int  r) const
inline

Definition at line 337 of file vnl_decnum.h.

◆ operator<=() [7/8]

bool vnl_decnum::operator<= ( int  r) const
inline

Definition at line 344 of file vnl_decnum.h.

◆ operator<=() [8/8]

bool vnl_decnum::operator<= ( double  r) const
inline

Definition at line 351 of file vnl_decnum.h.

◆ operator=() [1/8]

vnl_decnum& vnl_decnum::operator= ( const vnl_decnum r)
inline

Assignment operator; no compactification or expansion occurs.

Definition at line 174 of file vnl_decnum.h.

◆ operator=() [2/8]

vnl_decnum& vnl_decnum::operator= ( std::string const &  r)
inline

Definition at line 199 of file vnl_decnum.h.

◆ operator=() [3/8]

vnl_decnum& vnl_decnum::operator= ( char const *  r)
inline

Definition at line 200 of file vnl_decnum.h.

◆ operator=() [4/8]

vnl_decnum& vnl_decnum::operator= ( unsigned long  r)
inline

Definition at line 201 of file vnl_decnum.h.

◆ operator=() [5/8]

vnl_decnum& vnl_decnum::operator= ( long  r)
inline

Definition at line 202 of file vnl_decnum.h.

◆ operator=() [6/8]

vnl_decnum& vnl_decnum::operator= ( unsigned int  r)
inline

Definition at line 203 of file vnl_decnum.h.

◆ operator=() [7/8]

vnl_decnum& vnl_decnum::operator= ( int  r)
inline

Definition at line 204 of file vnl_decnum.h.

◆ operator=() [8/8]

vnl_decnum& vnl_decnum::operator= ( double  r)
inline

Definition at line 205 of file vnl_decnum.h.

◆ operator==() [1/8]

bool vnl_decnum::operator== ( vnl_decnum const &  r) const

Definition at line 124 of file vnl_decnum.cxx.

◆ operator==() [2/8]

bool vnl_decnum::operator== ( std::string const &  r) const
inline

Definition at line 305 of file vnl_decnum.h.

◆ operator==() [3/8]

bool vnl_decnum::operator== ( char const *  r) const
inline

Definition at line 312 of file vnl_decnum.h.

◆ operator==() [4/8]

bool vnl_decnum::operator== ( unsigned long  r) const
inline

Definition at line 319 of file vnl_decnum.h.

◆ operator==() [5/8]

bool vnl_decnum::operator== ( long  r) const
inline

Definition at line 326 of file vnl_decnum.h.

◆ operator==() [6/8]

bool vnl_decnum::operator== ( unsigned int  r) const
inline

Definition at line 333 of file vnl_decnum.h.

◆ operator==() [7/8]

bool vnl_decnum::operator== ( int  r) const
inline

Definition at line 340 of file vnl_decnum.h.

◆ operator==() [8/8]

bool vnl_decnum::operator== ( double  r) const
inline

Definition at line 347 of file vnl_decnum.h.

◆ operator>() [1/8]

bool vnl_decnum::operator> ( vnl_decnum const &  r) const
inline

Definition at line 301 of file vnl_decnum.h.

◆ operator>() [2/8]

bool vnl_decnum::operator> ( std::string const &  r) const
inline

Definition at line 308 of file vnl_decnum.h.

◆ operator>() [3/8]

bool vnl_decnum::operator> ( char const *  r) const
inline

Definition at line 315 of file vnl_decnum.h.

◆ operator>() [4/8]

bool vnl_decnum::operator> ( unsigned long  r) const
inline

Definition at line 322 of file vnl_decnum.h.

◆ operator>() [5/8]

bool vnl_decnum::operator> ( long  r) const
inline

Definition at line 329 of file vnl_decnum.h.

◆ operator>() [6/8]

bool vnl_decnum::operator> ( unsigned int  r) const
inline

Definition at line 336 of file vnl_decnum.h.

◆ operator>() [7/8]

bool vnl_decnum::operator> ( int  r) const
inline

Definition at line 343 of file vnl_decnum.h.

◆ operator>() [8/8]

bool vnl_decnum::operator> ( double  r) const
inline

Definition at line 350 of file vnl_decnum.h.

◆ operator>=() [1/8]

bool vnl_decnum::operator>= ( vnl_decnum const &  r) const
inline

Definition at line 303 of file vnl_decnum.h.

◆ operator>=() [2/8]

bool vnl_decnum::operator>= ( std::string const &  r) const
inline

Definition at line 310 of file vnl_decnum.h.

◆ operator>=() [3/8]

bool vnl_decnum::operator>= ( char const *  r) const
inline

Definition at line 317 of file vnl_decnum.h.

◆ operator>=() [4/8]

bool vnl_decnum::operator>= ( unsigned long  r) const
inline

Definition at line 324 of file vnl_decnum.h.

◆ operator>=() [5/8]

bool vnl_decnum::operator>= ( long  r) const
inline

Definition at line 331 of file vnl_decnum.h.

◆ operator>=() [6/8]

bool vnl_decnum::operator>= ( unsigned int  r) const
inline

Definition at line 338 of file vnl_decnum.h.

◆ operator>=() [7/8]

bool vnl_decnum::operator>= ( int  r) const
inline

Definition at line 345 of file vnl_decnum.h.

◆ operator>=() [8/8]

bool vnl_decnum::operator>= ( double  r) const
inline

Definition at line 352 of file vnl_decnum.h.

◆ operator>>() [1/2]

vnl_decnum vnl_decnum::operator>> ( long int  r) const
inline

Right "bit" shift operator (actually: digit shift, or exponent translation).

Definition at line 154 of file vnl_decnum.h.

◆ operator>>() [2/2]

vnl_decnum vnl_decnum::operator>> ( int  r) const
inline

Definition at line 155 of file vnl_decnum.h.

◆ operator>>=() [1/2]

vnl_decnum& vnl_decnum::operator>>= ( long int  r)
inline

Right "bit" shift operator (actually: digit shift, or exponent translation).

Definition at line 160 of file vnl_decnum.h.

◆ operator>>=() [2/2]

vnl_decnum& vnl_decnum::operator>>= ( int  r)
inline

Definition at line 161 of file vnl_decnum.h.

◆ plus()

vnl_decnum vnl_decnum::plus ( std::string const &  a,
std::string const &  b,
long  exp 
)
staticprivate

Returns the sum of the two first arguments (interpreted as mantissas with the same exponent).

Both arguments should consist of digits only. The third argument will be used as the exponent of the result.

Definition at line 187 of file vnl_decnum.cxx.

◆ pow()

vnl_decnum vnl_decnum::pow ( unsigned long  p) const
inline

Definition at line 359 of file vnl_decnum.h.

◆ roundup()

vnl_decnum vnl_decnum::roundup ( ) const
inline

Definition at line 356 of file vnl_decnum.h.

◆ sign()

char vnl_decnum::sign ( ) const
inline

Definition at line 99 of file vnl_decnum.h.

◆ trunc()

vnl_decnum vnl_decnum::trunc ( ) const
inline

Definition at line 355 of file vnl_decnum.h.

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  s,
vnl_decnum const &  r 
)
related

decimal output.

Definition at line 393 of file vnl_decnum.h.

◆ operator>>()

VNL_EXPORT std::istream & operator>> ( std::istream &  s,
vnl_decnum r 
)
related

decimal input.

Definition at line 411 of file vnl_decnum.cxx.

Member Data Documentation

◆ data_

std::string vnl_decnum::data_
private

Definition at line 89 of file vnl_decnum.h.

◆ exp_

long vnl_decnum::exp_
private

Definition at line 93 of file vnl_decnum.h.

◆ sign_

char vnl_decnum::sign_
private

Definition at line 88 of file vnl_decnum.h.


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