åçªã§ãã, ä¸è¨ã®ã³ã¼ããå®è¡ããã¨ãéãã®ã¯ã©ã¡ãã§ããã. ã¾ãæ¼ç®çµæã¯ã©ããªãã¨äºæ³ããã¾ãã. double calcd(int n) { double ret = 0; for (int i = 1; i < n; i++) { ret += 1 / double(i); } return ret; } float calcf(int n) { float ret = 0; for (int i = 1; i < n; i++) { ret += 1 / float(i); } return ret; } int main() { printf("calcf=%.15f\n", calcf(100000000)); printf("calcd=%.15f\n", calcd(100000000)); } floatåã¯é ã? ãã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}