Ad
  • Custom User Avatar

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

  • Custom User Avatar

    As you can see in my post above, I am taking in to considerantion that you can't have 0.whatever population by applying Math.round to my result (I am trying with Math.ceil as well and is not working). Is still not working for me, and, I am taking into consideration that the result should be >= to p. Can somebody help? or point me in the right direction without just giving me a dislike :|

  • Custom User Avatar

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

  • Default User Avatar

    Ok, I'm still not totally convinced but I've already made the corresponding adjustments and passed the tests. Thanks for your comments!

  • Custom User Avatar

    I don't think this will ever get resolved. Some people can't handle fractional people, others can't deal with continious functions. It's the battle of the ages.

  • Custom User Avatar

    @heblopez The error is right there, in the year 1...3 in the output of your solution. Population is the count of a species living in a certain area (in the context of the kata, the species is human). As stated by RileyHunter, you can't count a person partially. For example, let's look at the output of your solution. 1141.4, there are 1141 and 0.4 people in a certain area. What does the 0.4 indicates? You can't just have a person counted as 0.4.

  • Custom User Avatar

    Read the post of RileyHunter again, you can't have fractional people.

  • Default User Avatar

    "In the last basic test i get this error:

    IN: 1000 2.0 50 1214 Year 1: 1070.0 Year 2: 1141.4 Year 3: 1214.228

    3 should equal 4"

    The instructions state the following: "the function nb_year should return n number of entire years needed to get a population greater or equal to p."
    So even if I do not consider the decimals in the test I get the error, the result of year 3 already reaches the target quantity "p" that is received as a parameter. Where is the error?

  • Custom User Avatar

    For the first test case, your solution suggests that after year two there are 1858.75 people in the population - but can you really have three quarters of a person? Think about what data types you're using here and read the description carefully.

  • Default User Avatar

    I have the same error that @Xeferis mentions, when I click on the "Attempt" button I get the same message: "expected 3 to equal 4" but I don't understand why.

  • Default User Avatar