C++ Library Extensions 2022.12.09
To help learn modern C++ programming
008-real.cpp File Reference
#include <tpf_output.hpp>
#include <tpf_safe_type.hpp>
#include <cmath>
Include dependency graph for 008-real.cpp:

Go to the source code of this file.

Functions

void examine_integer_float_difference ()
 
template<typename Type >
types::enable_if_real_number_t< Type > safe_add (Type a, Type b)
 
template<typename Type >
types::enable_if_real_number_t< Type > safe_sub (Type a, Type b)
 
template<typename Type >
types::enable_if_real_number_t< Type > safe_mul (Type a, Type b)
 
template<typename Type >
types::enable_if_real_number_t< Type > safe_div (Type a, Type b)
 
void examples_for_safe_floating_point_arithmetic ()
 
int main ()
 

Variables

tpf::sstream stream
 
auto endl = tpf::endl
 

Function Documentation

◆ examine_integer_float_difference()

void examine_integer_float_difference ( )

Definition at line 8 of file 008-real.cpp.

◆ examples_for_safe_floating_point_arithmetic()

void examples_for_safe_floating_point_arithmetic ( )

Definition at line 139 of file 008-real.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( )

Definition at line 166 of file 008-real.cpp.

Here is the call graph for this function:

◆ safe_add()

template<typename Type >
types::enable_if_real_number_t< Type > safe_add ( Type  a,
Type  b 
)

Definition at line 69 of file 008-real.cpp.

Here is the caller graph for this function:

◆ safe_div()

template<typename Type >
types::enable_if_real_number_t< Type > safe_div ( Type  a,
Type  b 
)

Definition at line 123 of file 008-real.cpp.

Here is the caller graph for this function:

◆ safe_mul()

template<typename Type >
types::enable_if_real_number_t< Type > safe_mul ( Type  a,
Type  b 
)

Definition at line 105 of file 008-real.cpp.

◆ safe_sub()

template<typename Type >
types::enable_if_real_number_t< Type > safe_sub ( Type  a,
Type  b 
)

Definition at line 87 of file 008-real.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ endl

auto endl = tpf::endl

Definition at line 6 of file 008-real.cpp.

◆ stream

tpf::sstream stream

Definition at line 5 of file 008-real.cpp.