-
12345678910111213#include <bits/stdc++.h>using namespace std;int main(){unsigned long long a = pow(10ULL, 15);unsigned long long b = 8999999999999997;cout << a + b << endl;cout << fixed << pow(10ULL, 15) + b << endl;return 0;}cs
pow 는 float 라서 그냥 더하면 어지러운 상황이 일어날 수 있음(반드시 형변환 먼저 하고 더해야함)
'실수모음' 카테고리의 다른 글
[c++] unsigned int + int (0) 2022.12.21 [c++] % 연산시 주의할 점 (0) 2022.12.20 python 은 정수나눗셈이 // ! (0) 2022.12.18 c++ longlong 범위 (0) 2022.12.18 bitwise operator 는 부등호보다 연산자 우선순위 낮음 (0) 2022.08.31