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

Bounded::Float Template Class Reference

Bounded number with floating-point type. More...

#include <boundednumber.h>

List of all members.

Public Methods

 Float ()
 Default constructor. More...

 Float (value_type val)
 Constructs using specified value. More...

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

template<classOT, LargeIntOMaxVal, LargeIntOMinVal, classOBoundary>  Float<OT, OMaxVal, OMinVal, OBoundary> (const Integer<OT,OMaxVal,OMinVal, OBoundary>& other)
 Construct from a Bounded::Integer. More...

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

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

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


Static Public Attributes

const value_type Min = MinVal
 Minimum legal value. More...

const value_type Max = MaxVal
 Maximum legal value. More...


Detailed Description

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

Bounded number with floating-point type.

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 157 of file boundednumber.h.


Constructor & Destructor Documentation

template<classT = float, LargeIntMaxVal = 1, LargeIntMinVal = 0, classBoundary = Crop<LargeFloat>>
Bounded::Float<T, MaxVal, MinVal, Boundary>::Float<T, MaxVal, MinVal, Boundary> ( )
 

Default constructor.

Definition at line 169 of file boundednumber.h.

template<classT = float, LargeIntMaxVal = 1, LargeIntMinVal = 0, classBoundary = Crop<LargeFloat>>
Bounded::Float<T, MaxVal, MinVal, Boundary>::Float<T, MaxVal, MinVal, Boundary> ( value_type val )
 

Constructs using specified value.

Definition at line 170 of file boundednumber.h.

template<classT = float, LargeIntMaxVal = 1, LargeIntMinVal = 0, classBoundary = Crop<LargeFloat>>
Bounded::Float<T, MaxVal, MinVal, Boundary>::Float<T, MaxVal, MinVal, Boundary> ( const Float< T,MaxVal,MinVal,Boundary >& other )
 

Copy constructor.

Definition at line 171 of file boundednumber.h.

template<classT = float, LargeIntMaxVal = 1, LargeIntMinVal = 0, classBoundary = Crop<LargeFloat>>
template<classOT, LargeIntOMaxVal, LargeIntOMinVal, classOBoundary>
Bounded::Float<T, MaxVal, MinVal, Boundary>::Float<T, MaxVal, MinVal, Boundary> ( const Integer< OT,OMaxVal,OMinVal,OBoundary >& other )
 

Construct from a Bounded::Integer.

Definition at line 176 of file boundednumber.h.


Member Function Documentation

template<classT = float, LargeIntMaxVal = 1, LargeIntMinVal = 0, classBoundary = Crop<LargeFloat>>
Magnitude Bounded::Float<T, MaxVal, MinVal, Boundary>::mag ( ) const [inline]
 

Returns the current numeric value as a fraction of the maximum.

Definition at line 183 of file boundednumber.h.

template<classT = float, LargeIntMaxVal = 1, LargeIntMinVal = 0, classBoundary = Crop<LargeFloat>>
void Bounded::Float<T, MaxVal, MinVal, Boundary>::operator= ( const LargeFloat<T, MaxVal, MinVal, Boundary> & val ) [inline]
 

Set to a numeric value; assumes LargeFloat is an encompassing type.

Definition at line 180 of file boundednumber.h.

template<classT = float, LargeIntMaxVal = 1, LargeIntMinVal = 0, classBoundary = Crop<LargeFloat>>
value_type Bounded::Float<T, MaxVal, MinVal, Boundary>::raw ( ) const [inline]
 

Returns the current numeric value in the native units.

Definition at line 186 of file boundednumber.h.


Member Data Documentation

template<classT = float, LargeIntMaxVal = 1, LargeIntMinVal = 0, classBoundary = Crop<LargeFloat>>
const T Bounded::Float< T,MaxVal,MinVal,Boundary >::Max = MaxVal [static]
 

Maximum legal value.

Definition at line 193 of file boundednumber.h.

template<classT = float, LargeIntMaxVal = 1, LargeIntMinVal = 0, classBoundary = Crop<LargeFloat>>
const T Bounded::Float< T,MaxVal,MinVal,Boundary >::Min = MinVal [static]
 

Minimum legal value.

Definition at line 191 of file boundednumber.h.


The documentation for this class was generated from the following file:
Generated at Mon Aug 21 00:31:17 2000 for RF-LISSOM by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000