Ad
  • Custom User Avatar

    It shouldn't work with floats. If floats ar needed return must be changed from int to float

  • Custom User Avatar

    I just checked and yes, this seems to be the problem: C++ code and PHP code work differently, because / is integer division in C++, and not in PHP. After replacing / with intdiv in PHP, and making it equivalent with the C++ one, it worked.

    It's not a kata issue, the C++ and PHP code given above are not the same.

  • Custom User Avatar

    Deleted duplicate issue.

  • Custom User Avatar

    I deleted the duplicate issue.

    If someone is certain that these two codes are not equivalent and PHP is correctly rejected, please mark this issue as resoved (i cannot check exactly now).

  • Custom User Avatar

    You already raised one issue, so could you please remove the other one? These 2 code snippets don't look the same. / operator returns float values in PHP, whereas it does integer division in C++.

  • Custom User Avatar

    These two pieces of code are not the same. In C++, you have a global variable, which you do not have in PHP. Additionally I think (I can;t remember exactly tho) that in PHP the / works differently than in C++.

  • Custom User Avatar

    Without code formatting I cannot read the code, so I am not sure if both C++ and PHP code are the same. You'd need to post the code once again, using proper formatting this time, to make it readable (see the link I posted in my previous message).

  • Custom User Avatar

    But what exactly is the issue here? Is there a problem that something passed, but should not? Or that something did not pass, but should?

    Please remember to use code blocks when posting code.