Generation

generate functionSat, 12 Nov 2022

CALCULATE QUADRATIC EQUATION

fun quadraticEquation(a: Double, b: Double, c: Double): Double { val d = b * b - 4 * a * c return if (d > 0) { (-b + Math.sqrt(d)) / (2 * a) } else { (-b - Math.sqrt(d)) / (2 * a) } }

Questions about programming?Chat with your personal AI assistant