The difference (absolute) obviously increases, the relative error stays roughly the same.
This explains how they are encoded
https://en.wikipedia.org/wiki/Floating-point_arithmetic
Try this to see the difference
#include <iostream>
template <class A, class B>
double check(A && a, B && b) {
if (a > b) {
return a;
} else {
return b;
}
}
int main()
{
std::cout << static_cast<long long>(
check(2.0,
100000000000000013LL))
<< '\n';
std::cout << 100000000000000013LL;
}
I think it's too late for me to understand any of this😴😅
Mimi
scammer.xyz
Daniele°
olli
Rupesh
Droid
Dima
Ariana
Parra
元
Pawan
BinaryByter
Tolu
Wim
Darmawan