import { bnSqrt } from '@polkadot/util' ; import BN from 'bn.js' ; name summary param a param b param c export function solveQuadraticEquation ( a , b , c ) { const TWO = new BN ( 2 ) ; const FOUR = new BN ( 4 ) ; const result = b . neg ( ) . add ( bnSqrt ( b . pow ( TWO ) . sub ( FOUR . mul ( a ) . mul ( c ) ) ) ) . div ( TWO . mul ( a ) ) ; const result2 = b . neg ( ) . sub ( bnSqrt ( b . pow ( TWO ) . sub ( FOUR . mul ( a ) . mul ( c ) ) ) ) . div ( TWO . mul ( a ) ) ; return [ result , result2 ] ; }