Ad
  • Custom User Avatar

    You need use the complete path: System.Math.Sqrt()

  • Custom User Avatar

    Yes there is. You must use System.Math instead of just math.

  • Custom User Avatar

    Try sq to the power of 0.5. In Python 3:
    sq ** (0.5)

  • Custom User Avatar

    I have the same problem. I did find the square root by creating an inefficient algorithm. However, it cannot execute in this online IDE. (it's not efficient)

  • Custom User Avatar

    So by banks logic "in a year" means in 360 days...and it means that 6 more days are coming to finish a calendar year.

  • Custom User Avatar

    After a year: 100 -> 100,98 (100 * 1,0098 or 100 + 100 * 0,98 / 100 )

    so until that you compound annually

    361 / 100,9827489 362 / 100,9854978...

    and then daily...

    Try to compound always the same way.

  • Custom User Avatar

    Hello, I'm confused... and can't find my fault - please help!

    As an example you give "date_nb_days(100, 101, 0.98) --> "2017-01-01" (366 days)".
    After a year: 100 -> 100,98 (100 * 1,0098 or 100 + 100 * 0,98 / 100 ) and 360 days.
    InterestsPerDay now: 100,98 * 0,98 / 36000 = 0,0027489.
    days / sum
    361 / 100,9827489
    362 / 100,9854978
    363 / 100,9882467
    364 / 100,9909956
    365 / 100,9937445
    366 / 100,9964934
    367 / 100,9992423
    368 / 101,0019912

    other try:
    0,02 / 0,0027489 = 7,2756375277383680745025282840409

    Can you please explain, how you came to 366 days?

  • Custom User Avatar

    I think it may be helpful if you re-word the description, because it implies that the amount a0 is deposited every year. I would suggest that you phrase it as "You have an amount of money a0 > 0 and you deposit it on the 1st of January 2016, with an annual interest rate of p% > 0" This should help clear up the ambiguity in the first sentence. The reader can discern the intended meaning currently, but only because the date includes the year and thus an annual deposit wouldn't make sense. Also, you should add "compounded annually" or "compounded daily" to the end of that first sentence. Banks traditionally tell customers the interest rate in the form of the APY, which is annual, but the real interest rate is continuously compounded. So, it may be easier if you explicitly state how often it is compounded, because our banking conventions have separated the compounding frequency from the advertised "annual" rate.

  • Custom User Avatar

    I am trying to solve this with C#, which would use of the built-in sqrt() function, that function is even mentioned in the instructions. However, the test returns an error when I try to use it. Is there some special way that I need to call a mathematics library, or do I need to solve it without using the square root at all? The Java Test Reference uses Math.random(), so I would assume that such common libraries are available for all the languages.