Vita
Classes | Typedefs | Functions
vita::real Namespace Reference

We assume that errors during floating-point operations aren't terminal errors. More...

Classes

class  abs
 The absolute value of a real number. More...
 
class  add
 Sum of two real numbers. More...
 
class  aq
 Analytic quotient (AQ). More...
 
class  cos
 cos() of a real number. More...
 
class  div
 Unprotected division (UPD) between two real numbers. More...
 
class  gt
 "Greater Than" operator. More...
 
class  idiv
 Quotient of the division between two real numbers. More...
 
class  ifb
 "If between" operator. More...
 
class  ife
 "If equal" operator. More...
 
class  ifl
 "If less then" operator. More...
 
class  ifz
 "If zero" operator. More...
 
class  integer
 Ephemeral random integer constant. More...
 
class  length
 Length of a string. More...
 
class  ln
 Natural logarithm of a real number. More...
 
class  lt
 "Less Then" operator. More...
 
class  max
 The larger of two floating point values. More...
 
class  mod
 Remainder of the division between real numbers. More...
 
class  mul
 Product of real numbers. More...
 
class  real
 Ephemeral random constant. More...
 
class  sigmoid
 Sigmoid function. More...
 
class  sin
 sin() of a real number. More...
 
class  sqrt
 Square root of a real number. More...
 
class  sub
 Subtraction between real numbers. More...
 

Typedefs

using base_t = D_DOUBLE
 

Functions

base_t base (const value_t &v)
 A simple shortcut for casting an value_t to base_t. More...
 

Detailed Description

We assume that errors during floating-point operations aren't terminal errors.

So we dont't try to prevent domain errors (e.g. square root of a negative number) or range error (e.g. pow(10.0, 1e6)) checking arguments beforehand (domain errors could be prevented by carefully bounds checking the arguments before calling functions and taking alternative action if the bounds are violated; range errors usually cannot be prevented, as they are dependent on the implementation of floating-point numbers, as well as the function being applied). Instead we detect them and take alternative action (usually returning an empty value).

Typedef Documentation

◆ base_t

using vita::real::base_t = typedef D_DOUBLE

Definition at line 38 of file real.h.

Function Documentation

◆ base()

base_t vita::real::base ( const value_t v)
inline

A simple shortcut for casting an value_t to base_t.

Parameters
[in]vthe value that must be casted to base type (base_t)
Returns
the content of v
Examples
pathfinding01.cc, and pathfinding02.cc.

Definition at line 49 of file real.h.