本当はこれで結果に差が出てくれば,納得するんですが....
$ cat test.cpp
#include <iostream>
#include <bitset>
#include <cmath>
using namespace std;
typedef double Type;
template <class T> std::ostream & output_as_bits (std::ostream &p_os, const T &p, bool ascending_order = true);
const Type limit (numeric_limits <Type>::max ());
const Type half_of_limit (limit / 2);
template <typename T> T func1 (T p) {return p + half_of_limit;}
template <typename T> T func2 (T p) {return p + half_of_limit - half_of_limit;}
int main () {
Type d0 (limit); Type d1 (func1 (d0)); Type d2 (func2 (d0));
output_as_bits (cout, d0) << " " << isinf (d0) << " " << d0 << endl;
output_as_bits (cout, d1) << " " << isinf (d1) << " " << d1 << endl;
output_as_bits (cout, d2) << " " << isinf (d2) << " " << d2 << endl;
return 0;
}
$ g++ -O2 test.cpp; ./a.out
L1111111111111111111111111111111111111111111111111111011111111110H 0 1.79769e+308
L0000000000000000000000000000000000000000000000000000111111111110H 1 inf
L1111111111111111111111111111111111111111111111111111011111111110H 0 1.79769e+308
$ g++ -O2 -ffinite-math-only test.cpp; ./a.out
L1111111111111111111111111111111111111111111111111111011111111110H 0 1.79769e+308
L0000000000000000000000000000000000000000000000000000111111111110H 1 inf
L1111111111111111111111111111111111111111111111111111011111111110H 0 1.79769e+308
う〜む.同じだ.最初の実行結果の3行目がinfであって欲しいんですが.

>>710
ありがとう御座います.学ぶ足掛かりができました.