例如1.5mod998244353为什么等于499122178?
急急急!
3/2 对998244353取模后是499122178,是因为499122178*2%998244353=3
楼主解决了吗?我也想问这个问题
然而我这里测试,并不能编译
是不是你1.5强行转换成了整数,那么就要看是double还是float,转换成整数后1.5表示为多少了
main.cpp:6:14: error: invalid operands to binary expression ('double' and 'double')
int x = 1.5 % 998244353;
~~~ ^ ~~~~~~~~~
1 error generated.