Ad
  • Default User Avatar

    The author's solution as it exists does weird things on them, so for now, no.

  • Default User Avatar

    Well all data types have a "Limit" to what they can hold or accomplish. there are workarounds for this. but I came back to do this kaya just becuse I though someones comment may be funny. they way they had it writ down I went to view the comment and it said I had not completed this kata so instead of forfeiting to view it I just did it, and now I cant find the comment :/ I think something happened on the server and it gave me someone elses comment and now I cant find it :/ Edit: to the limit thing. that part of the comment was that maybe it should have been left as is so people do some research into the data types and range limits but the isSafeInteger is a nice JS but all it does is check what I just said. I used it myself I use so many languages 99% of them are spoecified the same but others are a little off for whatever purpose

  • Custom User Avatar

    There should now be tests for these :)

  • Custom User Avatar

    Exactly, upper bound and upper bound + 1.

    Currently, there only is a test for bound - 1.

  • Custom User Avatar

    Your right, I've changed the description and added a number of Random Tests.

    I'm not 100% sure what edge cases I'd have to deal with this though, apart from testing the upper bounds of the maximum value for an Integer I'm not sure what else I should be testing :/

  • Custom User Avatar

    Tests could still do with improvements. Static tests for edge cases, and random tests.

    Also, less than in the description should probably be changed to less than or equal to, and while we're at it, size to value.

  • Custom User Avatar
  • Custom User Avatar

    Well spotted, Number.isSafeInteger() should now work for this.

  • Custom User Avatar

    Thanks for this! I've added another Test case for this.

  • Custom User Avatar

    Testing logic is wrong. See my solution. Using Number.isSafeInteger() therefore gives wrong results, which it clearly shouldn't.

  • Custom User Avatar

    Please, set clearly what the max is. Improve testing to avoid cheating.

  • Custom User Avatar

    Should the plateaus be considered?

    If so, test cases should be reviewed