Theoretica
Mathematical Library
Loading...
Searching...
No Matches
error.h File Reference

Error handling. More...

#include <string>
#include <cerrno>
#include <limits>
#include "./constants.h"

Go to the source code of this file.

Namespaces

namespace  theoretica
 Main namespace of the library which contains all functions and objects.
 

Macros

#define TH_MATH_ERROR(F_NAME, VALUE, EXCEPTION)    { errno = theoretica::to_errno(EXCEPTION); }
 TH_MATH_ERROR is a macro which throws exceptions or modifies errno (depending on which compiling options are defined)
 

Enumerations

enum class  theoretica::MathError : int {
  theoretica::None = 0x00 , theoretica::DivByZero = 0x01 , theoretica::OutOfDomain = 0x02 , theoretica::OutOfRange = 0x04 ,
  theoretica::ImpossibleOperation = 0x08 , theoretica::NoConvergence = 0x10 , theoretica::InvalidArgument = 0x20
}
 Math error enumeration. More...
 

Functions

int theoretica::to_errno (MathError err)
 Convert an MathError class enum to conventional errno codes.
 
const char * theoretica::to_cstring (MathError err)
 Convert a MathError class enum to a string description.
 
std::string theoretica::to_string (MathError err)
 Convert a MathError class enum to a string description.
 
TH_CONSTEXPR real theoretica::nan ()
 Return a quiet NaN number in floating point representation.
 
template<typename T >
bool theoretica::is_nan (const T &x)
 Check whether a generic variable is (equivalent to) a NaN number.
 
TH_CONSTEXPR real theoretica::inf ()
 Get positive infinity in floating point representation.
 
bool theoretica::is_inf (real x)
 Check whether a real number is infinite.
 

Detailed Description

Error handling.