Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Problem z konwersją liczb

$
0
0
Witam. Mam problem z konwertowaniem liczb. Przykład: bool ok = true;       unsigned long long int decimal = 524288;     QString bin;     unsigned long long int octal = 0;     bin.setNum(decimal, 2);     octal = bin.toULongLong(&ok, 8);       if(ok == false) std::cout << "error\n";       std::cout << octal; I wyświetla wynik: 144115188075855872, a powinien wyświetlić 2000000 Przykład 2: bool ok = true;       unsigned long long int octal = 2000000;     QString bin;     unsigned long long int decimal = 0;     bin.setNum(octal, 2);     decimal = bin.toULongLong(&ok, 10);       if(ok == false) std::cout << "error\n";       std::cout << decimal; Wyświetla mi, że błąd. Co takiego robię źle ??

Viewing all articles
Browse latest Browse all 18427

Trending Articles