1. 36
  1.  

  2. 8

    The primary flaw: no tests for code that has explicit edge cases. Even the ‘prod quality version’ has no tests.

    1. 3

      This reminded me of a paper examining and quantifying the implications of insecure StackOverflow snippets on the security of Android apps.

      1. 2

        Instead of relying on a floating point log it should be pretty simple to modify this to do the needed integer log (it should be quite a bit faster)