Main Page   Namespace List   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

RazorBack::Fparch_ Class Template Reference

Objects of the Fparch_ class figure out as much as possible about the floating-point architecture of a machine. More...

#include <Fparch.hh>

List of all members.

Public Methods

 Fparch_ ()
 default ctor.

const struct utsname* system_descr () const
 returns the system description in a UNIX utsname struct.

int radix () const
 returns the radix of the floating-point representation.

int mantissa_digits () const
 returns the number of significant base-Radix digits in the mantissa.

int exponent_digits () const
 returns the number of significant base-Radix digits in the exponent.

int min_exp () const
 returns the minimal base-Radix exponent.

REAL smallest () const
 returns the smallest representable floating-point number.

int max_exp () const
 returns the maximal base-Radix exponent.

REAL largest () const
 returns the largest representable floating-point number.

int fpadd_round () const
 floating-point addition rounding index (0...5).

bool round_ieee754 () const
 returns true if rounding is IEEE-754 compliant.

bool round_non_ieee () const
 returns true if some rounding is done but is not IEEE.

bool fp_truncate () const
 returns true if floating-point addition truncates.

bool graceful_underflow () const
 returns true if IEEE "graceful underflow" is available.

int negep () const
 returns the largest negative integer such that 1.0-radix^negep() != 1.0, bounded by -(digits()+3) from below.

REAL epsneg () const
 returns a small real number such that 1.0-epsneg() != 1.0.

int machep () const
 returns the largest negative integer such that 1.0+radix^negep() != 1.0, bounded by -(digits()+3) from below.

REAL eps () const
 returns the smallest real number such that 1.0+eps() != 1.0.

int nguard () const
 Returns the number of guard digits for multiplication.


Static Protected Methods

REAL absolute (REAL x)

Private Attributes

struct utsname Utsname
int Radix
int Digits
int Rnd
int Negep
int Machep
int Nguard
int Expdigits
int Minexp
int Maxexp
REAL Epsneg
REAL Eps
REAL Smallest
REAL Largest

Static Private Attributes

const REAL ZERO
const REAL ONE
const REAL TWO


Detailed Description

template<class REAL> class RazorBack::Fparch_

Objects of the Fparch_ class figure out as much as possible about the floating-point architecture of a machine.

The template parameter REAL makes sense only if it is one of "float", "double" or "long double". Functionality is similar to that of <numeric_limits> in the standard C++ library. This class is provided so that you can get information about the floating-point architecture even if an ANSI C++ implementation is not available. The main difference is that the members are not static as I was too lazy to do the silly init for all static members before the ctor can be run. :-)

Definition at line 38 of file Fparch.hh.


Constructor & Destructor Documentation

template<class REAL>
RazorBack::Fparch_<REAL>::Fparch_<REAL> ( )
 

default ctor.


Member Function Documentation

template<class REAL>
const struct utsname * RazorBack::Fparch_<REAL>::system_descr ( ) const [inline]
 

returns the system description in a UNIX utsname struct.

Definition at line 55 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::radix ( ) const [inline]
 

returns the radix of the floating-point representation.

Definition at line 58 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::mantissa_digits ( ) const [inline]
 

returns the number of significant base-Radix digits in the mantissa.

Definition at line 61 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::exponent_digits ( ) const [inline]
 

returns the number of significant base-Radix digits in the exponent.

Definition at line 64 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::min_exp ( ) const [inline]
 

returns the minimal base-Radix exponent.

Definition at line 67 of file Fparch.hh.

template<class REAL>
REAL RazorBack::Fparch_<REAL>::smallest ( ) const [inline]
 

returns the smallest representable floating-point number.

Definition at line 70 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::max_exp ( ) const [inline]
 

returns the maximal base-Radix exponent.

Definition at line 73 of file Fparch.hh.

template<class REAL>
REAL RazorBack::Fparch_<REAL>::largest ( ) const [inline]
 

returns the largest representable floating-point number.

Definition at line 76 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::fpadd_round ( ) const [inline]
 

floating-point addition rounding index (0...5).

Definition at line 79 of file Fparch.hh.

template<class REAL>
bool RazorBack::Fparch_<REAL>::round_ieee754 ( ) const [inline]
 

returns true if rounding is IEEE-754 compliant.

Definition at line 82 of file Fparch.hh.

template<class REAL>
bool RazorBack::Fparch_<REAL>::round_non_ieee ( ) const [inline]
 

returns true if some rounding is done but is not IEEE.

Definition at line 85 of file Fparch.hh.

template<class REAL>
bool RazorBack::Fparch_<REAL>::fp_truncate ( ) const [inline]
 

returns true if floating-point addition truncates.

Definition at line 88 of file Fparch.hh.

template<class REAL>
bool RazorBack::Fparch_<REAL>::graceful_underflow ( ) const [inline]
 

returns true if IEEE "graceful underflow" is available.

Definition at line 91 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::negep ( ) const [inline]
 

returns the largest negative integer such that 1.0-radix^negep() != 1.0, bounded by -(digits()+3) from below.

Definition at line 97 of file Fparch.hh.

template<class REAL>
REAL RazorBack::Fparch_<REAL>::epsneg ( ) const [inline]
 

returns a small real number such that 1.0-epsneg() != 1.0.

Definition at line 100 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::machep ( ) const [inline]
 

returns the largest negative integer such that 1.0+radix^negep() != 1.0, bounded by -(digits()+3) from below.

Definition at line 106 of file Fparch.hh.

template<class REAL>
REAL RazorBack::Fparch_<REAL>::eps ( ) const [inline]
 

returns the smallest real number such that 1.0+eps() != 1.0.

Definition at line 109 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::nguard ( ) const [inline]
 

Returns the number of guard digits for multiplication.

Definition at line 112 of file Fparch.hh.

template<class REAL>
REAL RazorBack::Fparch_<REAL>::absolute ( REAL x ) [inline, static, protected]
 

Definition at line 116 of file Fparch.hh.


Member Data Documentation

template<class REAL>
const REAL RazorBack::Fparch_<REAL>::ZERO [static, private]
 

Definition at line 42 of file Fparch.hh.

template<class REAL>
const REAL RazorBack::Fparch_<REAL>::ONE [static, private]
 

Definition at line 42 of file Fparch.hh.

template<class REAL>
const REAL RazorBack::Fparch_<REAL>::TWO [static, private]
 

Definition at line 42 of file Fparch.hh.

template<class REAL>
struct utsname RazorBack::Fparch_<REAL>::Utsname [private]
 

Definition at line 44 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::Radix [private]
 

Definition at line 46 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::Digits [private]
 

Definition at line 46 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::Rnd [private]
 

Definition at line 46 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::Negep [private]
 

Definition at line 46 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::Machep [private]
 

Definition at line 46 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::Nguard [private]
 

Definition at line 46 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::Expdigits [private]
 

Definition at line 46 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::Minexp [private]
 

Definition at line 46 of file Fparch.hh.

template<class REAL>
int RazorBack::Fparch_<REAL>::Maxexp [private]
 

Definition at line 46 of file Fparch.hh.

template<class REAL>
REAL RazorBack::Fparch_<REAL>::Epsneg [private]
 

Definition at line 47 of file Fparch.hh.

template<class REAL>
REAL RazorBack::Fparch_<REAL>::Eps [private]
 

Definition at line 47 of file Fparch.hh.

template<class REAL>
REAL RazorBack::Fparch_<REAL>::Smallest [private]
 

Definition at line 47 of file Fparch.hh.

template<class REAL>
REAL RazorBack::Fparch_<REAL>::Largest [private]
 

Definition at line 47 of file Fparch.hh.


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:41 2002 for The Razorback C++ Library: Miscellaneous by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001