I found a strange behavior of std::cin (using VS 17 under Win 10): when a large number is entered, the number that std::cin is reading is close but different. Is there any kind of approximation done with large numbers ? How to get the exact same large number than entered ?
double n(0);
cout << "Enter a number > 0 (0 to exit): ";
cin.clear(); // does not help !
cin >> n; // enter 2361235441021745907775
printf("Selected number %.0f \n", n); // 2361235441021746151424 is processed ?.
Output
Enter a number > 0 (0 to exit):
2361235441021745907775
Selected number 2361235441021746151424