关于double
查看原帖
关于double
705012
Miss_SGT楼主2024/1/24 19:38

是只能存到1e16吗?

#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll R=1e18+2;
const ll r=1000000000000000002;
int main(){
    cerr<<R<<' '<<r<<'\n';
    return 0;
}

这份代码的输出是

1000000000000000000 1000000000000000002

但是这份就对了

```cpp
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll R=(ll)1e18+2;
const ll r=1000000000000000002;
int main(){
    cerr<<R<<' '<<r<<'\n';
    return 0;
}
2024/1/24 19:38
加载中...