float('∞')=float('inf')
"Considering that Python can't represent π in a float anyway, I wouldn't be too bothered. "
import math type(math.pi)
-- Gerald Britton
On Sat, Jul 13, 2013 at 1:16 AM, Gerald Britton
"Considering that Python can't represent π in a float anyway, I
wouldn't be too bothered. "
import math type(math.pi)
That's an approximation to pi, which is a standard floating-point value. It's simply 3.141592653589793, nothing more nor less. Infinity is a special floating-point value that actually represents the concept of infinity, not just some huge number. Hence, infinity is special, pi is not. IEEE floating point cannot represent pi, the square root of 2, or i, but it can represent infinity and nan, so there need to be ways to create those. ChrisA
On 12 July 2013 16:23, Chris Angelico
On Sat, Jul 13, 2013 at 1:16 AM, Gerald Britton
wrote: "Considering that Python can't represent π in a float anyway, I
wouldn't be too bothered. "
import math type(math.pi)
That's an approximation to pi, which is a standard floating-point value. It's simply 3.141592653589793, nothing more nor less.
Actually, it's 3.1415926535897932. 3.141592653589793 isn't a real floating-point number, and is "rounded" on evaluation. //Seriouslypedanticcomment
participants (3)
-
Chris Angelico
-
Gerald Britton
-
Joshua Landau