0
Approximate Cube Root
I found this code somewhere, the answer is getting some error margins in it. The answer should be a multiple of 0.01 but it is not. 20100×0.01=201, not 200.99999..... https://code.sololearn.com/cRjIy6cA9k6I/?ref=app
1 Resposta
+ 3
Decimals (floating point numbers) are often inaccurate.
You could round if the number is roughly 0.000001 away from a whole number. That could fix the issue for most values.