NullPointerException, Kotlin, the Square root of a BigDecimal?

val epsilon = 0.000000000000000000000001.toBigDecimal()
private val accuracy = MathContext(1000)
private val maxIteration = maxIteration
private fun doElipticK():BigDecimal{
println(epsilon)
 val epsilonSqrt = epsilon.sqrt(accuracy)

So the code works, but as soon as we add 0.000000000000000000000001 to the number of the received exception in which direction to look?
val epsilon = 0.000000000000000000000002.toBigDecimal()
private val accuracy = MathContext(1000)
private val maxIteration = maxIteration
private fun doElipticK():BigDecimal{
println(epsilon)
 val epsilonSqrt = epsilon.sqrt(accuracy)

NullPointerException
April 7th 20 at 15:40
2 answers
April 7th 20 at 15:42
In which line you got the NPE?
April 7th 20 at 15:44
Oh Kotlin, Kotlin...
To start could be podavaite to have people here had an understanding on what line your code crashes. Based on my guess (I don't know Kotlin) doEliptick is what method, what it does is hidden from us. Bet 5 cents that this method if something falls in it.
In General, you need debajit, and before you know he will understand what the problem is. Do not understand - throw here the full code and the line where drops.

Find more questions by tags JavaKotlin