Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91219266
Series.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 9, 02:26
Size
640 B
Mime Type
text/x-c
Expires
Mon, Nov 11, 02:26 (2 d)
Engine
blob
Format
Raw Data
Handle
22217687
Attached To
rSCIPROGHW SP4EHW
Series.cc
View Options
#include "Series.hh"
double
Series
::
getAnalyticPrediction
()
{
return
(
numeric_limits
<
double
>::
quiet_NaN
());
}
ComputeArithmetic
::
ComputeArithmetic
()
{
value
=
0
;
iter
=
1
;
}
double
ComputeArithmetic
::
compute
(
unsigned
int
N
)
{
for
(
int
i
=
iter
;
i
<
N
+
1
;
i
++
)
{
value
+=
i
;
iter
=
i
+
1
;
}
//iter=N+1;
return
(
value
);
}
ComputePi
::
ComputePi
()
{
value
=
0
;
iter
=
1
;
}
double
ComputePi
::
compute
(
unsigned
int
N
)
{
for
(
int
i
=
iter
;
i
<
N
+
1
;
i
++
)
{
value
+=
6.0
/
i
/
i
;
iter
=
i
+
1
;
}
//iter=N+1;
return
(
sqrt
(
value
));
}
double
ComputePi
::
getAnalyticPrediction
()
{
return
(
M_PI
);
}
Event Timeline
Log In to Comment