C/C++の宿題片付けま ..
192:175
09/05/24 01:02:49
>>172 間違い。1.0!=1.0+εとなる最小のεではなかった。
#include <stdio.h>
#include <float.h>
#include <math.h>
int main() {
double e1, e2;
unsigned int n;
e1 = DBL_MIN;
printf("%.15e %.15e\n", DBL_MIN, DBL_EPSILON);
for(n=1; n<4294967295u; n++) {
e2 = e1 * 10;
if(1.0 != (1.0 + e2)) break;
e1 = e2;
}
printf("%.15e %d\n", e1, n-1);
}
次ページ最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5337日前に更新/150 KB
担当:undef