Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Bounded::Float< T, MaxVal, MinVal, Boundary > Class Template Reference

#include <boundednumber.h>

List of all members.


Detailed Description

template<class T, LargeInt MaxVal = 1, LargeInt MinVal = 0, class Boundary = Crop<LargeFloat>>
class Bounded::Float< T, MaxVal, MinVal, Boundary >

Bounded number with floating-point type.

See the Integer class for more details.

The template can be instantiated for any floating-point type smaller than or equal to type LargeFloat.

Unfortunately, because the C++ standard explicitly disallows floating-point template literal arguments (without giving any rationale!), the MaxVal and MinVal must always be integers representable in type LargeInt, even though the underlying type is floating-point. Luckily bounds are usually integers anyway.

Definition at line 130 of file boundednumber.h.

Public Methods

 Float ()
 Default constructor.

 Float (value_type val)
 Constructs using specified value.

 Float (const Float< T, MaxVal, MinVal, Boundary > &other)
 Copy constructor.

template<class OT, LargeInt OMaxVal, LargeInt OMinVal, class OBoundary>  Float (const Integer< OT, OMaxVal, OMinVal, OBoundary > &other)
 Construct from a Bounded::Integer.

void operator= (const LargeFloat &val)
 Set to a numeric value; assumes LargeFloat is an encompassing type.

Magnitude mag () const
 Returns the current numeric value as a fraction of the maximum.

value_type raw () const
 Returns the current numeric value in the native units.


Static Public Attributes

const value_type Min = MinVal
 Minimum legal value.

const value_type Max = MaxVal
 Maximum legal value.


The documentation for this class was generated from the following file:
Generated on Mon Jan 20 02:37:34 2003 for RF-LISSOM by doxygen1.3-rc2