Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
pi
Commits
c0fd414c
Commit
c0fd414c
authored
6 years ago
by
Neil Gershenfeld
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
68d1de0b
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#2868
passed
6 years ago
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
JavaScript/inlinepi.html
+43
-0
43 additions, 0 deletions
JavaScript/inlinepi.html
JavaScript/serialpi.html
+28
-0
28 additions, 0 deletions
JavaScript/serialpi.html
with
71 additions
and
0 deletions
JavaScript/inlinepi.html
0 → 100644
+
43
−
0
View file @
c0fd414c
<html>
<body>
<script>
//
// inlinepi.js
// Neil Gershenfeld 11/24/18
// pi calculation benchmark
// pi = 3.14159265358979323846
//
function
pi
()
{
var
points
=
1
e9
var
a
=
0.5
var
b
=
0.75
var
c
=
0.25
var
pi
=
0
var
tstart
=
Date
.
now
()
/
1000
for
(
var
i
=
1
;
i
<=
points
;
++
i
)
pi
+=
a
/
((
i
-
b
)
*
(
i
-
c
))
var
tend
=
Date
.
now
()
/
1000
var
mflops
=
points
*
5.0
*
1
e
-
6
/
(
tend
-
tstart
)
console
.
log
(
'
function:
'
)
console
.
log
(
'
pi:
'
+
pi
)
console
.
log
(
'
time:
'
+
(
tend
-
tstart
).
toFixed
(
1
)
+
'
s
'
)
console
.
log
(
'
estimated MFlops:
'
+
mflops
.
toFixed
(
1
))
}
pi
()
var
points
=
1
e8
var
a
=
0.5
var
b
=
0.75
var
c
=
0.25
var
pi
=
0
var
tstart
=
Date
.
now
()
/
1000
for
(
var
i
=
1
;
i
<=
points
;
++
i
)
pi
+=
a
/
((
i
-
b
)
*
(
i
-
c
))
var
tend
=
Date
.
now
()
/
1000
var
mflops
=
points
*
5.0
*
1
e
-
6
/
(
tend
-
tstart
)
console
.
log
(
'
inline:
'
)
console
.
log
(
'
pi:
'
+
pi
)
console
.
log
(
'
time:
'
+
(
tend
-
tstart
).
toFixed
(
1
)
+
'
s
'
)
console
.
log
(
'
estimated MFlops:
'
+
mflops
.
toFixed
(
1
))
</script>
</body>
</html>
This diff is collapsed.
Click to expand it.
JavaScript/serialpi.html
0 → 100644
+
28
−
0
View file @
c0fd414c
<html>
<body>
<script>
//
// serialpi.js
// Neil Gershenfeld 11/24/18
// pi calculation benchmark
// pi = 3.14159265358979323846
//
function
pi
()
{
var
points
=
1
e10
var
a
=
0.5
var
b
=
0.75
var
c
=
0.25
var
pi
=
0
var
tstart
=
Date
.
now
()
/
1000
for
(
var
i
=
1
;
i
<=
points
;
++
i
)
pi
+=
a
/
((
i
-
b
)
*
(
i
-
c
))
var
tend
=
Date
.
now
()
/
1000
var
mflops
=
points
*
5.0
*
1
e
-
6
/
(
tend
-
tstart
)
console
.
log
(
'
pi:
'
+
pi
)
console
.
log
(
'
time:
'
+
(
tend
-
tstart
).
toFixed
(
1
)
+
'
s
'
)
console
.
log
(
'
estimated MFlops:
'
+
mflops
.
toFixed
(
1
))
}
pi
()
</script>
</body>
</html>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment