Created
November 21, 2012 01:11
-
-
Save sampottinger/4122419 to your computer and use it in GitHub Desktop.
Mysterious function...
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
import math | |
def F4(n): | |
if n == 0.0: | |
return 1.0 | |
else: | |
part = (0.5 * (F4(n - 1.0)))**2.0 | |
return math.sqrt(part + (1.0 - math.sqrt(1.0 - part))**2.0) | |
n = float(raw_input("Type in your value: ")) # Here's where I'm inputting the value | |
print "You put in %f." % n | |
print "The answer is %f." % F4(n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment