4 ms·
I found this rather strange. Use of the word "calculate" is a bit of a stretch with dealing with a lookup table to get results. Worth reading, however.
by hellofunk 11y ago
I found this rather strange. Use of the word "calculate" is a bit of a stretch with dealing with a lookup table to get results. Worth reading, however.
- bemmu 11y agoWell in the first example it's calculated, just at compile time.
- dietrichepp 11y agoI don't think it's really a stretch. It's the classic tradeoff: space versus time. The results are the same.
- mzl 11y agoThe point is that the lookup table contains results for _all_ inputs to the function that have a defined result (that is, functions that do not trigger overflow and thus undefined behaviour). In that sense, it has the same semantics as the original function although most people would not suspect that.
- liquidise 11y agoWatch it. i've "calculated" more than a few project euler solutions this way.