Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
pi
Commits
c50ef58c
Commit
c50ef58c
authored
Oct 16, 2020
by
Neil Gershenfeld
Browse files
wip
parent
29109c57
Pipeline
#8267
passed with stage
in 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Python/numpi.py
View file @
c50ef58c
...
...
@@ -17,5 +17,5 @@ i = arange(1,(NPTS+1),dtype=float64)
pi
=
sum
(
0.5
/
((
i
-
0.75
)
*
(
i
-
.
25
)))
end_time
=
time
.
time
()
mflops
=
NPTS
*
5.0
/
(
1.0e6
*
(
end_time
-
start_time
))
print
"NPTS = %d, pi = %f"
%
(
NPTS
,
pi
)
print
"time = %f, estimated MFlops = %f"
%
(
end_time
-
start_time
,
mflops
)
print
(
"NPTS = %d, pi = %f"
%
(
NPTS
,
pi
)
)
print
(
"time = %f, estimated MFlops = %f"
%
(
end_time
-
start_time
,
mflops
)
)
Python/pi.py
View file @
c50ef58c
...
...
@@ -17,6 +17,6 @@ for i in range(1,(NPTS+1)):
pi
+=
a
/
((
i
-
b
)
*
(
i
-
c
))
end_time
=
time
.
time
()
mflops
=
NPTS
*
5.0
/
(
1.0e6
*
(
end_time
-
start_time
))
print
"NPTS = %d, pi = %f"
%
(
NPTS
,
pi
)
print
"time = %f, estimated MFlops = %f"
%
(
end_time
-
start_time
,
mflops
)
print
(
"NPTS = %d, pi = %f"
%
(
NPTS
,
pi
)
)
print
(
"time = %f, estimated MFlops = %f"
%
(
end_time
-
start_time
,
mflops
)
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment