我有数据类型unsigned __int128 data;
,所以我认为这不是类型问题,但我不知道为什么会发生
#include <stdio.h>
int main(int argc, char *argv[]) {
unsigned __int128 z = 1911602146;
unsigned __int128 n = 4003562209;
//case 1
unsigned __int128 result = fmod((pow(z, 2) * 2), n);
printf("%d\n", result);
//case 2
unsigned __int128 result_2 = fmod(pow(z, 2), n);
printf("%d\n", result_2);
}
返回:
-669207835 => this is the correct option and it should be 7629321670
-480306461