-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf8960c
commit 9f566f2
Showing
5 changed files
with
56 additions
and
2 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 |
---|---|---|
|
@@ -35,4 +35,5 @@ lang-sentences* | |
/venv310/ | ||
/cmake-build-debug-docker/ | ||
/build-docs/ | ||
.vscode | ||
/a.out.dSYM/ | ||
a.out |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "for", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"preLaunchTask": "ipwr", | ||
"program": "${workspaceFolder}/a.out", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${workspaceFolder}", | ||
"environment": [], | ||
"externalConsole": false, | ||
"MIMode": "gdb" | ||
}, | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "shell", | ||
"label": "ipwr", | ||
"command": "gfortran pdp10/algebra/ipwr.for -g -O0 -fbacktrace -fcheck=all -ffpe-trap=zero,overflow,underflow -Wall -Wextra -Warray-temporaries -Wconversion -ffree-line-length-0", | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
program hello | ||
integer :: i | ||
real :: pi | ||
pi = 3.1415927 | ||
i = 0 | ||
i = i + 1 | ||
print *, 'Hello, World!', pi | ||
end program hello | ||
|
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,9 +1,21 @@ | ||
""" imaginary powers of base 10. starting with 10**(i/1024), and squaring successively ten times""" | ||
""" imaginary powers of base 10. starting with 10**(i/1024), and squaring successively ten times. this matches with feynman's table 22-3""" | ||
from math import sqrt | ||
|
||
# non rounded version | ||
y = .00225 # should be .0022486 | ||
x = sqrt(1. - y**2) | ||
for _ in range(11): | ||
print('%10.7f %10.7f' % (x, y)) | ||
x2 = x**2 - y**2 | ||
y2 = 2 * x * y | ||
x, y = x2, y2 | ||
|
||
# rounded version that more closely matches feynman's table 22-3 | ||
y = .00225 # should be .0022486 | ||
x = round(sqrt(1. - y**2), 7) | ||
for _ in range(11): | ||
print('%10.5f %10.5f' % (x, y)) | ||
x2 = round(x**2 - y**2, 7) | ||
y2 = round(2 * x * y, 7) | ||
x, y = x2, y2 | ||
|