r/programming • • May 09 '15

"Real programmers can do these problems easily"; author posts invalid solution to #4

https://blog.svpino.com/2015/05/08/solution-to-problem-4
3.1k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

0

u/[deleted] May 09 '15

[deleted]

1

u/glemnar May 09 '15

log() isn't O(1) for big enough numbers.

It's all perspective : D

0

u/[deleted] May 09 '15

[deleted]

2

u/glemnar May 09 '15 edited May 09 '15

It depends. http://stackoverflow.com/questions/7317414/what-is-the-complexity-of-the-log-function

Besides, if you allow for arbitrary precision difference you just get a wrong answer. At high enough scales, even simple operations aren't O(1) is the point.

http://en.wikipedia.org/wiki/Computational_complexity_of_mathematical_operations