C++ (Qt)int main(){ std::ofstream out("test.txt"); std::uniform_real_distribution<double> dist(0.0, 1.0); std::mt19937 gen; const double epsilon = 0.001; const unsigned N = 100; for (unsigned i = 0; i < N; ++i) { double s = dist(gen); double n = dist(gen); out << i << " " << log((s + epsilon)/(n + epsilon)) << std::endl; } return 0;}
C++ (Qt)double sn = log((s + epsilon)/(n + epsilon));
C++ (Qt)double sn = log((fabs(s) + epsilon)/(fabs(n) + epsilon));
C++ (Qt)try { if(i<0xffffffff) i++; else throw "Integer overflow";}catch(const char* ex) //...}
C++ (Qt)std::numeric_limits<int>::max()