+ 4

Why 20

function calcD(a, b, c) { return b*b - 4*a*c; } var test = calcD(-4, 2, 1); alert(test); // 20

29th Apr 2017, 10:17 AM
Kristina Hakobyan
Kristina Hakobyan - avatar
3 Answers
+ 12
a = -4, b = 2, c = 1 b * b - 4 * a * c = (2 * 2) - (4 * -4 * 1) = (4) - (-16) = 4 + 16 = 20
29th Apr 2017, 10:19 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 11
a = -4 b = 2 c = 1 b*b - 4*a*c === 2*2 - 4*(-4)*1 4 + 16 = 20
29th Apr 2017, 10:21 AM
Burey
Burey - avatar
+ 4
yes - and - will be plus it's mathematics but I don't knew which in js working look like it thx so much
29th Apr 2017, 10:21 AM
Kristina Hakobyan
Kristina Hakobyan - avatar