// FLOAT 大小比較 EPS
#include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
#define EPS (1e-9)
#define FLOAT FLOAT_
template <class T>
struct FLOAT
{
T value;
FLOAT(T _) : value(_) { }
FLOAT operator +() const { return *this; }
FLOAT operator -() const { return -value; }
FLOAT operator +(FLOAT _) const { return value + _.value; }
FLOAT operator -(FLOAT _) const { return value - _.value; }
FLOAT operator *(FLOAT _) const { return value * _.value; }
FLOAT operator /(FLOAT _) const { return value / _.value; }
FLOAT & operator +=(FLOAT _) { value += _.value; return *this; }
FLOAT & operator -=(FLOAT _) { value -= _.value; return *this; }
FLOAT & operator *=(FLOAT _) { value *= _.value; return *this; }
FLOAT & operator /=(FLOAT _) { value /= _.value; return *this; }
bool operator ==(FLOAT _) const { return abs(value - _.value) < EPS; }
bool operator !=(FLOAT _) const { return abs(value - _.value) > EPS; }
bool operator < (FLOAT _) const { return value - _.value < -EPS; }
bool operator <=(FLOAT _) const { return value - _.value < EPS; }
bool operator > (FLOAT _) const { return value - _.value > EPS; }
bool operator >=(FLOAT _) const { return value - _.value > -EPS; }
};
template <class T> inline ostream& operator << (ostream &out, FLOAT<T> _) { out << _.value; return out; }
template <class T> inline istream& operator >> (istream &in, FLOAT<T> &_) { in >> _.value; return in; }
#define double FLOAT<double>
#define float FLOAT<float>
int main()
{
double d = 1e-11f;
cout << d << endl;
cout << "(d == d + d) = " << (d == d + d) << endl; // true.
cout << "(d == 1e-10f) = " << (d == 1e-10f) << endl; // true.
d *= 1e3;
cout << "(d == d + d) = " << (d == d + d) << endl; // false.
double e = EPS;
e += d + 1e-11f;
e *= 10000;
cout << "cout e = " << e << endl;
printf("printf e = %0.12f\n", e);
return 0;
}