SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWDecimalInexactErr< M > Class Template Reference

Signals problems in computations involving the Rogue Wave decimal classes. More...

#include <rw/currency/decimal.h>

Inheritance diagram for RWDecimalInexactErr< M >:
RWExternalErr RWxmsg

Public Member Functions

RWDecimal< M > leftOperand () const
 
const char * msg () const
 
RWDecimalBase::Op operation () const
 
RWDecimal< M > rightOperand () const
 
- Public Member Functions inherited from RWxmsg
 RWxmsg (const char *msg)
 
 RWxmsg (const RWxmsg &msg)
 
 RWxmsg (RWxmsg &&msg)
 
RWxmsgoperator= (const RWxmsg &)
 
RWxmsgoperator= (RWxmsg &&msg)
 
virtual void raise () const
 
void swap (RWxmsg &rhs)
 
virtual const char * why () const
 

Additional Inherited Members

- Protected Member Functions inherited from RWxmsg
 RWxmsg (const char *msg, bool doCopy)
 

Detailed Description

template<class M>
class RWDecimalInexactErr< M >

RWDecimalInexactErr is one of the error objects used to signal problems in computations involving RWDecimal and RWFixedDecimal objects. The other error object is RWDecimalOverflowErr. See RWDecimal and RWFixedDecimal for details about when the error objects are used. Also, see the section on error handling in the Currency Module User's Guide for information about how to set error handlers.

Synopsis
#include <rw/currency/decimal.h> // for RWDecimalInexactErr<T>
// and RWDecimalOverflowErr<T>
#include <rw/currency/mp2int.h> // For RWMP2Int
RWDecimal<RWMP2Int> a = "9.9999999999";
RWDecimal<RWMP2Int> b = a * a; // calls the inexact error handler
Exactly represents a decimal fraction.
Definition decimal.h:246

The following header files are available for backward compatibility:

#include <rw/dec52.h> // RWDecimal52InexactErr,
// RWDecimal52OverflowErr
#include <rw/dec64.h> // RWDecimal64InexactErr,
// RWDecimal64OverflowErr
#include <rw/dec96.h> // RWDecimal96InexactErr,
// RWDecimal96OverflowErr

Member Function Documentation

◆ leftOperand()

template<class M >
RWDecimal< M > RWDecimalInexactErr< M >::leftOperand ( ) const
inline

Returns the left operand of the operation that generated the error object.

◆ msg()

template<class M >
const char * RWDecimalInexactErr< M >::msg ( ) const
inline

Returns a message describing the error.

◆ operation()

template<class M >
RWDecimalBase::Op RWDecimalInexactErr< M >::operation ( ) const
inline

Returns the operation that generated the error object. The returned value RWDecimalBase::Op is an enumerated type scoped in the RWDecimalBase class.

◆ rightOperand()

template<class M >
RWDecimal< M > RWDecimalInexactErr< M >::rightOperand ( ) const
inline

Returns the right operand of the operation that generated the error object.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.