#include <boundednumber.h>
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... | |
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.
|
||||
|
Default constructor.
Definition at line 169 of file boundednumber.h. |
|
||||
|
Constructs using specified value.
Definition at line 170 of file boundednumber.h. |
|
||||
|
Copy constructor.
Definition at line 171 of file boundednumber.h. |
|
||||||
|
Construct from a Bounded::Integer.
Definition at line 176 of file boundednumber.h. |
|
||||
|
Returns the current numeric value as a fraction of the maximum.
Definition at line 183 of file boundednumber.h. |
|
||||
|
Set to a numeric value; assumes LargeFloat is an encompassing type.
Definition at line 180 of file boundednumber.h. |
|
||||
|
Returns the current numeric value in the native units.
Definition at line 186 of file boundednumber.h. |
|
|||
|
Maximum legal value.
Definition at line 193 of file boundednumber.h. |
|
|||
|
Minimum legal value.
Definition at line 191 of file boundednumber.h. |
1.2.1 written by Dimitri van Heesch,
© 1997-2000