Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWDecimalPortable


RWDecimalPortable RWDecimalBase

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <rw/decport.h>

RWDecimalPortable dec;     // construct a decimal == 0
dec = "1.23";              // construct a decimal == 1.23

Description

RWDecimalPortable represents an arbitrary precision decimal fraction.

The RWDecimalPortable class is designed to provide maximum portability. The portability achieved in RWDecimalPortable is gained at the expense of speed and power. For example, RWDecimalPortable does not support all of the functionality of the other decimal classes. In most cases we recommend that you use another of the decimal classes, but in situations in which the portability of a number is paramount, RWDecimalPortable is useful.

Related Classes

RWDecimalBase contains the following enum, used by the round() method:

enum RoundingMethod { PLAIN = 0, UP = 1, DOWN = 2, 
                      BANKERS = 3, TRUNCATE = 2 };

Public Constructors

RWDecimalPortable();
RWDecimalPortable(const char* input);
RWDecimalPortable(long intPart);

Public Member Operator

operator RWCString();

Public Member Functions

virtual RWspace
binaryStoreSize() const;
friend unsigned
hash() const;
RWBoolean
isNumber() const;
friend void
restoreFrom(RWFile& file);
friend void
restoreFrom(RWvistream& vis);
friend void
saveOn(RWFile& file) const;
friend void
saveOn(RWvostream& vos) const;
void
trimZeros();

Related Global Functions

RWDecimalPortable
round(const RWDecimalPortable&, int digits,
      RoundingMethod = RWDecimalBase::PLAIN);
double
toDouble(const RWDecimalPortable&);

Related Global Operators

RWDecimalPortable 
operator-(const RWDecimalPortable&);
RWDecimalPortable 
operator+(const RWDecimalPortable&,
          const RWDecimalPortable&);
RWDecimalPortable 
operator-(const RWDecimalPortable&, 
          const RWDecimalPortable&);
RWDecimalPortable 
operator*(const RWDecimalPortable&,
          const RWDecimalPortable&);
RWBoolean 
operator==(const RWDecimalPortable& x, 
           const RWDecimalPortable& y);
RWBoolean 
operator>=(const RWDecimalPortable& x, 
           const RWDecimalPortable& y);
RWBoolean 
operator!=(const RWDecimalPortable& x, 
           const RWDecimalPortable& y);
RWBoolean 
operator<(const RWDecimalPortable& x, 
          const RWDecimalPortable& y);
RWBoolean 
operator>(const RWDecimalPortable& x, 
          const RWDecimalPortable& y);
RWBoolean 
operator<=(const RWDecimalPortable& x, 
           const RWDecimalPortable& y);
ostream&
operator<<(ostream&, const RWDecimalPortable&);
ostream&
operator>>(istream&, RWDecimalPortable&);


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.