Ad
  • Default User Avatar

    I think that whoever coded the random tests for Perl made a mistake. I get the following test failures occasionally:

    dec_2_fact_string(92351059480)
    Test Failed
    got: '10A964666212200'
    expected: 'EA964666212200'

    But the expected answer is clearly wrong, as the Nth rightmost digit in the number must always be below N by definition. The last digit can only be 0, the second-last can only be 0 or 1 and so on. And if the factorial-base number has 14 digits, it can't have the digit "E" anywhere, since it represents 14!