Last active
January 17, 2016 02:18
-
-
Save MyklClason/2b54c52c1b209b4e288a to your computer and use it in GitHub Desktop.
Old math joke: A piece of pi (Python)
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 random | |
import math | |
# Ideally, this would return x such that, 0 < x < pi | |
# For use in cases where you need to calculate things like, | |
# the "sum of the square root, minus a piece of pi" | |
# (it's less amusing if I give the source, Google is your friend) | |
def a_piece_of_pi(): | |
return random.random(0,math.pi) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment