收敛速度惊人
#include <stdio.h> /* 自然对数的底e = 2.718281828... */ double GenerateBaseE(const size_t N) { double ret = 1.0; unsigned long long k = 1; for (size_t i = 1; i <= N; ++i) { k *= i; ret += 1.0 / k; } return ret; } int main(int argc, char* argv[]) { printf("exp = %.9f\n", GenerateBaseE(14)); return 0; }