Ad
  • Custom User Avatar

    it is not.. in javascript, anything divided by zero equals to infinity..

    so infinity will always be greater than 2

    Unless of course, it is negative infinity haha..

    in that case negative infinity will always be lesser than 2

    And also, if you got 0 dragons to kill and 0 bullets to use

    in javascript, 0 divided by 0 will be NaN

    Well.. the story clearly says there will be dragons and as a hero you should always bring a weapon if you're gonna kill that dragon..
    so negative bullets is highly unlikely
    also, 0 dragons and 0 bullets

    But you got a point! HEHE

  • Custom User Avatar

    If dragons == 0 then it will be mistake

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I stored the addition to the exponent in a new variable to make it more readable. And this way the addition is only done once. It should not be grouped with the addition being done twice.