Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Related Functions
vnl_decnum Class Reference

#include <vnl_decnum.h>

List of all members.

Public Member Functions

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

Static Private Member Functions

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

Private Attributes

char sign_
vcl_string data_
long exp_

Related Functions

(Note that these are not member functions.)

vcl_ostream & operator<< (vcl_ostream &s, vnl_decnum const &r)
 decimal output.
vcl_istream & operator>> (vcl_istream &s, vnl_decnum &r)
 decimal input.

Detailed Description

Definition at line 80 of file vnl_decnum.h.


Constructor & Destructor Documentation

vnl_decnum::vnl_decnum ( char  s,
vcl_string const &  d,
long  e 
) [inline, private]

Definition at line 90 of file vnl_decnum.h.

vnl_decnum::vnl_decnum ( ) [inline]

Default constructor - creates the number zero.

Definition at line 96 of file vnl_decnum.h.

vnl_decnum::vnl_decnum ( vnl_decnum const &  r) [inline]

Definition at line 98 of file vnl_decnum.h.

vnl_decnum::vnl_decnum ( vcl_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::vnl_decnum ( char const *  r) [inline]

Definition at line 107 of file vnl_decnum.h.

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::vnl_decnum ( long  r) [inline, explicit]

Creates a vnl_decnum from a long integer.

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

Definition at line 112 of file vnl_decnum.h.

vnl_decnum::vnl_decnum ( unsigned int  r) [inline, explicit]

Creates a vnl_decnum from an unsigned integer.

Uses the "unsigned long" constructor.

Definition at line 117 of file vnl_decnum.h.

vnl_decnum::vnl_decnum ( int  r) [inline, explicit]

Creates a vnl_decnum from an integer.

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

Definition at line 122 of file vnl_decnum.h.

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 ( ) [inline]

Definition at line 130 of file vnl_decnum.h.


Member Function Documentation

vnl_decnum vnl_decnum::abs ( ) const [inline]

Definition at line 349 of file vnl_decnum.h.

static vcl_string vnl_decnum::add_zeros ( vcl_string const &  source,
unsigned long  n 
) [inline, static, private]

Definition at line 371 of file vnl_decnum.h.

vnl_decnum vnl_decnum::ceil ( ) const [inline]

Definition at line 353 of file vnl_decnum.h.

bool vnl_decnum::comp ( vcl_string const &  a,
vcl_string const &  b 
) [static, private]

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.

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.

vcl_string vnl_decnum::data ( ) const [inline]

Definition at line 92 of file vnl_decnum.h.

vcl_string vnl_decnum::div ( vcl_string const &  a,
vcl_string &  b 
) [static, private]

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.

long vnl_decnum::exp ( ) const [inline]

Definition at line 94 of file vnl_decnum.h.

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 166 of file vnl_decnum.h.

vnl_decnum vnl_decnum::floor ( ) const [inline]

Definition at line 352 of file vnl_decnum.h.

vnl_decnum vnl_decnum::minus ( vcl_string const &  a,
vcl_string const &  b,
long  exp 
) [static, private]

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.

vcl_string vnl_decnum::mult ( vcl_string const &  a,
char  b 
) [static, private]

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.

vnl_decnum::operator int ( ) const

Definition at line 114 of file vnl_decnum.cxx.

vnl_decnum::operator long ( ) const

Definition at line 95 of file vnl_decnum.cxx.

vnl_decnum::operator unsigned int ( ) const

Definition at line 105 of file vnl_decnum.cxx.

vnl_decnum::operator unsigned long ( ) const

Definition at line 86 of file vnl_decnum.cxx.

vnl_decnum::operator vcl_string ( ) const

Implicit type conversion to a decimal string.

Definition at line 72 of file vnl_decnum.cxx.

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

Definition at line 295 of file vnl_decnum.h.

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

Definition at line 302 of file vnl_decnum.h.

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

Definition at line 309 of file vnl_decnum.h.

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

Definition at line 316 of file vnl_decnum.h.

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

Definition at line 323 of file vnl_decnum.h.

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

Definition at line 330 of file vnl_decnum.h.

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

Definition at line 337 of file vnl_decnum.h.

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

Definition at line 344 of file vnl_decnum.h.

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.

vnl_decnum vnl_decnum::operator% ( vcl_string const &  r) const [inline]

Definition at line 234 of file vnl_decnum.h.

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

Definition at line 235 of file vnl_decnum.h.

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

Definition at line 236 of file vnl_decnum.h.

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

Definition at line 237 of file vnl_decnum.h.

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

Definition at line 238 of file vnl_decnum.h.

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

Definition at line 239 of file vnl_decnum.h.

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

Definition at line 240 of file vnl_decnum.h.

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

Definition at line 190 of file vnl_decnum.h.

vnl_decnum& vnl_decnum::operator%= ( vcl_string const &  r) [inline]

Definition at line 246 of file vnl_decnum.h.

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

Definition at line 252 of file vnl_decnum.h.

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

Definition at line 258 of file vnl_decnum.h.

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

Definition at line 264 of file vnl_decnum.h.

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

Definition at line 270 of file vnl_decnum.h.

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

Definition at line 276 of file vnl_decnum.h.

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

Definition at line 282 of file vnl_decnum.h.

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

Product.

Definition at line 289 of file vnl_decnum.cxx.

vnl_decnum vnl_decnum::operator* ( vcl_string const &  r) const [inline]

Definition at line 218 of file vnl_decnum.h.

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

Definition at line 219 of file vnl_decnum.h.

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

Definition at line 220 of file vnl_decnum.h.

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

Definition at line 221 of file vnl_decnum.h.

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

Definition at line 222 of file vnl_decnum.h.

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

Definition at line 223 of file vnl_decnum.h.

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

Definition at line 224 of file vnl_decnum.h.

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

Definition at line 188 of file vnl_decnum.h.

vnl_decnum& vnl_decnum::operator*= ( vcl_string const &  r) [inline]

Definition at line 244 of file vnl_decnum.h.

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

Definition at line 250 of file vnl_decnum.h.

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

Definition at line 256 of file vnl_decnum.h.

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

Definition at line 262 of file vnl_decnum.h.

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

Definition at line 268 of file vnl_decnum.h.

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

Definition at line 274 of file vnl_decnum.h.

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

Definition at line 280 of file vnl_decnum.h.

vnl_decnum vnl_decnum::operator+ ( ) const [inline]

Unary plus operator.

Definition at line 141 of file vnl_decnum.h.

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

Sum.

Definition at line 241 of file vnl_decnum.cxx.

vnl_decnum vnl_decnum::operator+ ( vcl_string const &  r) const [inline]

Definition at line 202 of file vnl_decnum.h.

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

Definition at line 203 of file vnl_decnum.h.

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

Definition at line 204 of file vnl_decnum.h.

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

Definition at line 205 of file vnl_decnum.h.

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

Definition at line 206 of file vnl_decnum.h.

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

Definition at line 207 of file vnl_decnum.h.

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

Definition at line 208 of file vnl_decnum.h.

vnl_decnum& vnl_decnum::operator++ ( ) [inline]

prefix increment (++b).

Definition at line 285 of file vnl_decnum.h.

vnl_decnum vnl_decnum::operator++ ( int  ) [inline]

postfix increment (b++).

Definition at line 289 of file vnl_decnum.h.

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

Definition at line 186 of file vnl_decnum.h.

vnl_decnum& vnl_decnum::operator+= ( vcl_string const &  r) [inline]

Definition at line 242 of file vnl_decnum.h.

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

Definition at line 248 of file vnl_decnum.h.

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

Definition at line 254 of file vnl_decnum.h.

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

Definition at line 260 of file vnl_decnum.h.

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

Definition at line 266 of file vnl_decnum.h.

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

Definition at line 272 of file vnl_decnum.h.

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

Definition at line 278 of file vnl_decnum.h.

vnl_decnum vnl_decnum::operator- ( ) const [inline]

Unary minus operator.

Definition at line 143 of file vnl_decnum.h.

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

Difference.

Definition at line 173 of file vnl_decnum.h.

vnl_decnum vnl_decnum::operator- ( vcl_string const &  r) const [inline]

Definition at line 210 of file vnl_decnum.h.

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

Definition at line 211 of file vnl_decnum.h.

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

Definition at line 212 of file vnl_decnum.h.

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

Definition at line 213 of file vnl_decnum.h.

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

Definition at line 214 of file vnl_decnum.h.

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

Definition at line 215 of file vnl_decnum.h.

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

Definition at line 216 of file vnl_decnum.h.

vnl_decnum& vnl_decnum::operator-- ( ) [inline]

decrement.

Definition at line 287 of file vnl_decnum.h.

vnl_decnum vnl_decnum::operator-- ( int  ) [inline]

decrement.

Definition at line 291 of file vnl_decnum.h.

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

Definition at line 187 of file vnl_decnum.h.

vnl_decnum& vnl_decnum::operator-= ( vcl_string const &  r) [inline]

Definition at line 243 of file vnl_decnum.h.

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

Definition at line 249 of file vnl_decnum.h.

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

Definition at line 255 of file vnl_decnum.h.

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

Definition at line 261 of file vnl_decnum.h.

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

Definition at line 267 of file vnl_decnum.h.

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

Definition at line 273 of file vnl_decnum.h.

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

Definition at line 279 of file vnl_decnum.h.

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.

vnl_decnum vnl_decnum::operator/ ( vcl_string const &  r) const [inline]

Definition at line 226 of file vnl_decnum.h.

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

Definition at line 227 of file vnl_decnum.h.

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

Definition at line 228 of file vnl_decnum.h.

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

Definition at line 229 of file vnl_decnum.h.

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

Definition at line 230 of file vnl_decnum.h.

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

Definition at line 231 of file vnl_decnum.h.

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

Definition at line 232 of file vnl_decnum.h.

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

Definition at line 189 of file vnl_decnum.h.

vnl_decnum& vnl_decnum::operator/= ( vcl_string const &  r) [inline]

Definition at line 245 of file vnl_decnum.h.

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

Definition at line 251 of file vnl_decnum.h.

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

Definition at line 257 of file vnl_decnum.h.

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

Definition at line 263 of file vnl_decnum.h.

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

Definition at line 269 of file vnl_decnum.h.

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

Definition at line 275 of file vnl_decnum.h.

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

Definition at line 281 of file vnl_decnum.h.

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

Definition at line 162 of file vnl_decnum.cxx.

bool vnl_decnum::operator< ( vcl_string const &  r) const [inline]

Definition at line 301 of file vnl_decnum.h.

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

Definition at line 308 of file vnl_decnum.h.

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

Definition at line 315 of file vnl_decnum.h.

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

Definition at line 322 of file vnl_decnum.h.

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

Definition at line 329 of file vnl_decnum.h.

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

Definition at line 336 of file vnl_decnum.h.

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

Definition at line 343 of file vnl_decnum.h.

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

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

Definition at line 146 of file vnl_decnum.h.

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

Definition at line 147 of file vnl_decnum.h.

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

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

Definition at line 152 of file vnl_decnum.h.

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

Definition at line 153 of file vnl_decnum.h.

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

Definition at line 297 of file vnl_decnum.h.

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

Definition at line 304 of file vnl_decnum.h.

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

Definition at line 311 of file vnl_decnum.h.

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

Definition at line 318 of file vnl_decnum.h.

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

Definition at line 325 of file vnl_decnum.h.

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

Definition at line 332 of file vnl_decnum.h.

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

Definition at line 339 of file vnl_decnum.h.

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

Definition at line 346 of file vnl_decnum.h.

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

Assignment operator; no compactification or expansion occurs.

Definition at line 169 of file vnl_decnum.h.

vnl_decnum& vnl_decnum::operator= ( vcl_string const &  r) [inline]

Definition at line 194 of file vnl_decnum.h.

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

Definition at line 195 of file vnl_decnum.h.

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

Definition at line 196 of file vnl_decnum.h.

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

Definition at line 197 of file vnl_decnum.h.

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

Definition at line 198 of file vnl_decnum.h.

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

Definition at line 199 of file vnl_decnum.h.

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

Definition at line 200 of file vnl_decnum.h.

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

Definition at line 124 of file vnl_decnum.cxx.

bool vnl_decnum::operator== ( vcl_string const &  r) const [inline]

Definition at line 300 of file vnl_decnum.h.

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

Definition at line 307 of file vnl_decnum.h.

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

Definition at line 314 of file vnl_decnum.h.

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

Definition at line 321 of file vnl_decnum.h.

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

Definition at line 328 of file vnl_decnum.h.

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

Definition at line 335 of file vnl_decnum.h.

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

Definition at line 342 of file vnl_decnum.h.

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

Definition at line 296 of file vnl_decnum.h.

bool vnl_decnum::operator> ( vcl_string const &  r) const [inline]

Definition at line 303 of file vnl_decnum.h.

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

Definition at line 310 of file vnl_decnum.h.

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

Definition at line 317 of file vnl_decnum.h.

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

Definition at line 324 of file vnl_decnum.h.

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

Definition at line 331 of file vnl_decnum.h.

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

Definition at line 338 of file vnl_decnum.h.

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

Definition at line 345 of file vnl_decnum.h.

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

Definition at line 298 of file vnl_decnum.h.

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

Definition at line 305 of file vnl_decnum.h.

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

Definition at line 312 of file vnl_decnum.h.

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

Definition at line 319 of file vnl_decnum.h.

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

Definition at line 326 of file vnl_decnum.h.

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

Definition at line 333 of file vnl_decnum.h.

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

Definition at line 340 of file vnl_decnum.h.

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

Definition at line 347 of file vnl_decnum.h.

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

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

Definition at line 149 of file vnl_decnum.h.

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

Definition at line 150 of file vnl_decnum.h.

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

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

Definition at line 155 of file vnl_decnum.h.

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

Definition at line 156 of file vnl_decnum.h.

vnl_decnum vnl_decnum::plus ( vcl_string const &  a,
vcl_string const &  b,
long  exp 
) [static, private]

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.

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

Definition at line 354 of file vnl_decnum.h.

vnl_decnum vnl_decnum::roundup ( ) const [inline]

Definition at line 351 of file vnl_decnum.h.

char vnl_decnum::sign ( ) const [inline]

Definition at line 93 of file vnl_decnum.h.

vnl_decnum vnl_decnum::trunc ( ) const [inline]

Definition at line 350 of file vnl_decnum.h.


Friends And Related Function Documentation

vcl_ostream & operator<< ( vcl_ostream &  s,
vnl_decnum const &  r 
) [related]

decimal output.

Definition at line 388 of file vnl_decnum.h.

vcl_istream & operator>> ( vcl_istream &  s,
vnl_decnum r 
) [related]

decimal input.

Definition at line 411 of file vnl_decnum.cxx.


Member Data Documentation

vcl_string vnl_decnum::data_ [private]

Definition at line 83 of file vnl_decnum.h.

long vnl_decnum::exp_ [private]

Definition at line 87 of file vnl_decnum.h.

char vnl_decnum::sign_ [private]

Definition at line 82 of file vnl_decnum.h.


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