Last answered:

02 Dec 2021

Posted on:

02 Dec 2021

0

Unction round() does not work properly when applied to % return.

Unction round() does not work properly when applied to % return.

1 answers ( 0 marked as helpful)
Posted on:

02 Dec 2021

0

Unfortunately, this problem has to do with the different ways in which 32- and 64-bit systems work.

You may obtain an erroneous output (e.g. 26.046000000000003%) if the result of the round() function has been multiplied by a hundred:

round(log_return_a, 5) * 100

On the contrary, such an erroneous output is not visualized if the round() function has been executed solely,
like this:

round(log_return_a, 5)

If you are interested and ready for a serious technical challenge, you can read more on this subject here.

https://github.com/bbcmicrobit/micropython/issues/367

Submit an answer