Program się kompiluje:
#include <iostream>
#include <cmath>
#include <stdio.h>
#include <chrono>
//unsigned __int128 r;
uint64_t LCG(uint64_t LCG_state)
{
LCG_state = (LCG_state * 2862933555777941757 + 1422359891750319841);
return LCG_state;
}
int main()
{
auto begin = std::chrono::high_resolution_clock::now();
double a = 0;
uint64_t LCG_state = 333;
uint32_t result;
for(int i=0; i<100; i++)
{
auto begin = std::chrono::high_resolution_clock::now();
for(int i=0; i<640000000; i++)
{
LCG_state = LCG(LCG_state);
result = LCG_state >> 32;
//std::cout << wynik << "\n";
}
auto end = std::chrono::high_resolution_clock::now();
auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin);
printf("Time measured: %.3f seconds.\n", elapsed.count() * 1e-9);
a = a + (elapsed.count() * 1e-9);
}
__asm__ volatile("" : "+g" (result) : :);
std::cout << a/100;
}
Ale próba zadeklarowania unsigned __int128 r pokazuje błąd expected unqualified-id before '__int128'.