Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
KvadrFunc
SUBMITTED BY:
Guest
DATE:
April 18, 2014, 11:28 a.m.
FORMAT:
C++
SIZE:
289 Bytes
Raw
Download
Tweet
HITS:
711
Go to comments
Report
static
int
KvadrFunc
(
double
A
,
double
B
,
double
*
X
)
{
double
D
=
pow2
(
A
,
2
)
-
4
*
B
;
if
(
D
<
0
)
return
0
;
if
(
D
==
0
)
{
X
[
0
]
=
-
A
/
2
;
X
[
1
]
=
-
A
/
2
;
return
1
;
}
X
[
0
]
=
(
-
A
+
sqrt
(
D
))
/
2
;
X
[
1
]
=
(
-
A
-
sqrt
(
D
))
/
2
;
return
2
;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus