Base Framework
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Float Class Reference

Float. More...

#include <base/Float.h>

Inherits Object.

Public Member Functions

 Float () noexcept
 
 Float (float _value) noexcept
 
 Float (const Float &copy) noexcept
 
Floatoperator= (const Float &assign) noexcept
 
Floatoperator= (float value) noexcept
 
float getValue () const noexcept
 
void setValue (float value) noexcept
 
bool isNegative () const noexcept
 
float getSign () const noexcept
 
bool isOrdinary () const noexcept
 
bool isInfinity () const noexcept
 
bool isNaN () const noexcept
 
bool isQuiteNaN () const noexcept
 
bool isSignalingNaN () const noexcept
 
 operator float () const noexcept
 

Static Public Member Functions

static float getMinimum () noexcept
 
static float getMaximum () noexcept
 
static float getEpsilon () noexcept
 
static float getInfinity () noexcept
 
static float getNaN () noexcept
 

Protected Attributes

float value = 0
 

Detailed Description

Float.

This class is a wrapper for the float primitive.

Version
1.0

Constructor & Destructor Documentation

◆ Float() [1/3]

Float::Float ( )
inlinenoexcept

Initializes the value as zero.

◆ Float() [2/3]

Float::Float ( float  _value)
inlinenoexcept

Initializes the float with the specified value. Implicit initialization is allowed.

Parameters
valueThe desired value.

◆ Float() [3/3]

Float::Float ( const Float copy)
inlinenoexcept

Initializes the value by other value.

Member Function Documentation

◆ getEpsilon()

static float Float::getEpsilon ( )
staticnoexcept

The difference between 1 and the least value greater than 1 that is representable in the given floating point type.

◆ getInfinity()

static float Float::getInfinity ( )
inlinestaticnoexcept

Returns infinity.

◆ getMaximum()

static float Float::getMaximum ( )
staticnoexcept

Maximum representable finite floating-point number (2^e_max).

◆ getMinimum()

static float Float::getMinimum ( )
staticnoexcept

Minimum normalized positive floating-point number (2^(e_min-1)).

◆ getNaN()

static float Float::getNaN ( )
inlinestaticnoexcept

Returns quiet NaN. Signaling NaN should be avoided due to platform inconsistencies.

◆ getSign()

float Float::getSign ( ) const
inlinenoexcept

Returns the sign.

◆ getValue()

float Float::getValue ( ) const
inlinenoexcept

Returns the value of the float.

◆ isInfinity()

bool Float::isInfinity ( ) const
inlinenoexcept

Returns true if the value is either +INFINITY or -INFINITY.

◆ isNaN()

bool Float::isNaN ( ) const
inlinenoexcept

Returns true if the value is Not a Number (NaN).

◆ isNegative()

bool Float::isNegative ( ) const
inlinenoexcept

Returns true if the value is negative.

◆ isOrdinary()

bool Float::isOrdinary ( ) const
inlinenoexcept

Returns true if the value is an ordinary number (not infinity or NaN).

◆ isQuiteNaN()

bool Float::isQuiteNaN ( ) const
inlinenoexcept

Returns true if the value is a quite NaN. A NaN that behaves predictably and does not raise exceptions in arithmetic operations is called a quiet NaN.

◆ isSignalingNaN()

bool Float::isSignalingNaN ( ) const
inlinenoexcept

Returns true if the value is a signaling NaN. A NaN that generally raises an exception when encountered as an operand of arithmetic operations is called a signaling NaN.

◆ operator float()

Float::operator float ( ) const
inlinenoexcept

Casts value to float primitive.

◆ operator=() [1/2]

Float& Float::operator= ( const Float assign)
inlinenoexcept

Assignment of value by value.

◆ operator=() [2/2]

Float& Float::operator= ( float  value)
inlinenoexcept

Assignment of this value by float primitive.

◆ setValue()

void Float::setValue ( float  value)
inlinenoexcept

Sets the value of the float.

Parameters
valueThe desired value.

Member Data Documentation

◆ value

float Float::value = 0
protected

The value.