Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
standardize output format output dict from pisum actual fail and catch workaround autoscale log bug ordered plots results
- Loading branch information
Showing
17 changed files
with
230 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ git: | |
quiet: true | ||
|
||
python: | ||
- 2.7 | ||
- 3.5 | ||
- 3.6 | ||
- pypy3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
from __future__ import division | ||
import cython | ||
|
||
@cython.boundscheck(False) | ||
@cython.wraparound(False) | ||
def pisum(int N): | ||
# import cython | ||
# for this problem, these options didn't have a noticable speed impact: | ||
# @cython.boundscheck(False) | ||
# @cython.wraparound(False) | ||
def pisum(N: int) -> float: | ||
""" | ||
Machin formula for Pi http://mathworld.wolfram.com/PiFormulas.html | ||
""" | ||
cdef float s | ||
cdef int k | ||
|
||
s = 0. | ||
for k in range(1, N+1): | ||
s += (-1)**(k+1) / (2*k-1) | ||
return 4.*s | ||
|
||
return 4.*s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.