Created
January 23, 2017 09:03
-
-
Save JasonSpine/fd6e22967a538edb5a18e96f0b075ec8 to your computer and use it in GitHub Desktop.
Integral - rectangle method
This file contains hidden or 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
#python < 3.0 | |
import math | |
x=1.0 #starting argument | |
dx=0.0001 #delta | |
result=0.0 | |
while x<=200.0: #ending argument | |
x+=dx | |
fx=1.0/x #integrable function | |
result+=dx*fx | |
print("%20.53lf"%(result)) #output the result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment