![](/static/253f0d9b/assets/icons/icon-96x96.png)
![](https://programming.dev/pictrs/image/170721ad-9010-470f-a4a4-ead95f51f13b.png)
1·
1 year agoWe got nerd sniped at almost the exact same time, but approached this in very different ways. I applaud your practical approach, but based on what I calculated, you should stop now. It will never reach 99.999%
We got nerd sniped at almost the exact same time, but approached this in very different ways. I applaud your practical approach, but based on what I calculated, you should stop now. It will never reach 99.999%
A few calculations:
1/ln(x)
.
Solving 99.9995 = 100 - 100 / ln(x)
for x gives e^200000
or 7.88 × 10^86858
. In other words, the universe will end before any current computer could check that many numbers.To be fair, I used to work there, and not even Microsoft understands their docs.
One thing to remember is that arrays are just pointers under the hood. Even if you don’t use them directly, or are always using smart pointers like
std::shared_ptr<T>
, they’re still there.For example, accessing the following array:
Realistically in modern C++ you could likely avoid raw pointers entirely. C++ references cover a ton of the pointer use cases. I’d say the main goal is to prevent data from being copied around needlessly, since that takes more time and memory bandwidth.