next up previous
Next: $B$3$NJ8=q$K$D$$$F(B... Up: 2 $B Previous: 2.2 $B7W;;$r7+$jJV$9$H4]$a8m:9$,C_@Q$5$l$k(B

2.3 $B7W;;5!%$%W%7%m%s$r5a$a$kDj@W

test-round2.c

/*
 * test-round2.c --- $BM-L>$J7W;;5!&E$r5a$a$k%3!<%I$r4]$a%b!<%I$rJQ$($F$J7W;;5!&E$r5a$a$k%3!<%I$r;0$D$N4]$a%b!<%I$GF0$+$9(B\n");
  printf("\nrounding to the nearest even\n"); find_eps();
  printf("\nrounding toward the minus infinity\n"); Down(); find_eps();
  printf("\nrounding toward the plus infinity\n");   Up();   find_eps();

  printf("...$B>e$X$N4]$a$G$O7W;;5!&E$O5a$^$i$J$$(B\n");
  return 0;
}

test-round2 $B$N

$BM-L>$J7W;;5!&E$r5a$a$k%3!<%I$r;0$D$N4]$a%b!<%I$GF0$+$9(B

rounding to the nearest even
eps=1.11022e-16=2^{-53}
eps_M=2.22045e-16

rounding toward the minus infinity
eps=1.11022e-16=2^{-53}
eps_M=2.22045e-16

rounding toward the plus infinity
$B7W;;5!&E$O5a$^$j$^$;$s$G$7$?!#(Beps=4.94066e-324 $B$KBP$7$F(B 1+eps>1
...$B>e$X$N4]$a$G$O7W;;5!&E$O5a$^$i$J$$(B


next up previous
Next: $B$3$NJ8=q$K$D$$$F(B... Up: 2 $B Previous: 2.2 $B7W;;$r7+$jJV$9$H4]$a8m:9$,C_@Q$5$l$k(B
Masashi Katsurada
$BJ?@.(B14$BG/(B11$B7n(B11$BF|(B