Ad
  • Custom User Avatar

    Not sure really whether this is an issue or not... but you can solve your problem by simply not rounding your answer. The description never said to round your answer, just that it had to be within 1e-6 of the reference answer.

  • Custom User Avatar

    Error in random tests TypeScript/Javascript:
    for n = 6: expected 1.212499 to be close to 1.2125000000000001 +/- 0.000001

  • Custom User Avatar

    Difficulty a bit overrated ?

  • Custom User Avatar

    joli exercice de style

  • Custom User Avatar

    Hi
    Working with python, I was blocked with the condition on acceleration : if gamma<1e-5 gamma = 0
    In fact , it works with abs(gamma) or without any condition ...
    Printing the gamma values ,I realized at the end what the gamma values were and that explained my issue :-)

  • Custom User Avatar

    Hi
    This kata permits me to understand the huge differences in performance among the different types of data structures
    The main part of the code (calculation of the values in the cells) has quite no effect in the perfs

  • Custom User Avatar

    IMHO , for the parameteers instead of 'new_stock' , the term 'delivery' or 'new_delivery' seems more appropriate to the objet of the calculations

  • Custom User Avatar

    Just checked. There are two "if"s and two "me"s

    I'll remove the duplicates when I have a moment

    Thanks

  • Custom User Avatar

    Hi

    I have filtered the words beginning with 'if' from dictionnary. result : ['if', 'if']

    Is it normal to find duplicates in the dictionary ?

  • Custom User Avatar

    Has anyone seen the picture announced in the description ?

  • Custom User Avatar

    You've renamed the function. The way the tests work is that they call your function with the function argument. If you rename the function, the tests try to call a function that doesn't exist which will cause an error. Also, the function input is a string, so your function wouldn't work correctly even if it had the correct name.

  • Custom User Avatar

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

  • Custom User Avatar

    I agree , yesterday I wrote a post with the same source above. I am a newbye in round function :)

    Nevertheless, to avoid issues with the different modes of calculations, dont you think that an unique rounding is more appropriate.

  • Custom User Avatar

    the result depends on the parity of the last unit before the dot .

    Is this really strange? This is what the "half to even" rounding mode is, a.k.a. "banker's rounding". It is also documented.

  • Custom User Avatar

    sorry to have launched such an animated discussion :) , but I discovered the strange behaviour of round with that kata :

    370+370 * 0.15 = 425.5 and round(370+370 * 0.15) = 426

    270+270 * 0.15 = 310.5 and round(270+270 * 0.15) = 310

    the result depends on the parity of the last unit before the dot .

    In that kata , IMHO , the issue is that we understand we must made a first rounding to get an integer and after a second rounding to round to 5 if the unit of the first rounding is between 1 and 4. ( the same with values between 6 and 9 to round to the next tenth)

    With an unique rounding (the second one) , no issue : if the result is >x0.0 , you round the price with x5. with a result >x5.0 you round the price to (x+1)0

  • Loading more items...