cosmotool/src/mach.hpp

21 lines
239 B
C++
Raw Normal View History

2011-12-14 04:43:53 +01:00
#ifndef __COSMO_MACHINE_TEST_HPP
#define __COSMO_MACHINE_TEST_HPP
#include <iostream>
2012-03-29 21:54:34 +02:00
template<typename T>
T mach_epsilon()
{
T eps = (T)1;
do
{
eps /= 2;
}
while ((T)(1 + (eps/2)) != (T)1);
return eps;
}
#endif