Ad
  • Custom User Avatar
  • Custom User Avatar

    This has to do with floating point rounding errors. The formula can be rearranged a little bit so that the rounding errors have less impact, I believe.

  • Default User Avatar

    I suppose you don't read the note at the bottom of the page:

    In Javascript, Coffeescript, Typescript, C++, PHP, C, R, Nim to get around the fact that we have no big integers 
    
    the function easyLine(n) will in fact return round(log(easyline(n))) and not the easyline(n) of the other languages.
    
    So, in Javascript, Coffeescript, Typescript, C++, PHP, R, Nim and C:
    
    easyLine(0) => 0
    easyLine(1) => 1
    easyLine(4) => 4
    easyLine(50) => 67
    

    Beware when you post issue:-)

  • Default User Avatar

    To post an issue believing is not enough:-) Give some explanation...

  • Default User Avatar

    9 guys passed the R kata, not that much but enough to say there are no errors in the tests.
    81 guys passed the Python translation and 21 the Ruby one. Python and Ruby give the same results as my R solution for your two cases.
    The number of digits of the numerator for your two cases have exactly the required length.