Returns the round off unit for double precision arithmetic.

View versions (1)

Interface

#include <codecogs/computing/lowlevel/machine_epsilon.h>

using namespace Computing::Lowlevel;

The machine epsilon, $\epsilon$ is defined as the smallest positive number such that $1.0 + \epsilon$ is not equal to 1.0.

Example 1

#include <codecogs/computing/lowlevel/machine_epsilon.h>
#include <iostream>
#include <iomanip>
int main()
{
  std::cout << "epsilon = ";
  std::cout << std::setprecision(15) << Computing::Lowlevel::machine_epsilon();
  std::cout << std::endl;
  return 0;
}

Output:

epsilon = 2.22044604925031e-016

References

SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.html

Returns

the round off unit for double precision arithmetic
GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

Result