Код: Выделить всё
#include
int main()
{
char sy[80];
double d = -0.58609953401145276;
for (int i = 0; i < 10; i++)
{
#pragma warning(suppress : 4996)
sprintf(sy, "%12.0lf", d);
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78685224/inconsistent-rounding-in-c-sprintf[/url]