Advertisement

a number for pi

Started by February 07, 2003 12:08 PM
27 comments, last by JYoung 21 years, 11 months ago
Assuming your using a 387 chip or above...

There is actually an intruction to push an 80-bit value of pi onto the FPU register stack. It saves you the expense of a memory call and you get the extended-precision (80-bit) value. Only use it if you are looking to eek out an extra fraction of a microsecond of CPU time.
3.1415926 is tedious
3.1415926 is a literal
3.1415926 is an f9
3.1415926 is good enough
3.1415926 is good enough for many applications
3.1415926 is the latest
3.1415926 is a constant or numeric literal
3.1415926 is a real number
3.1415926 is a magic number ? pi is a good identifier
3.1415926 is closer to
3.1415926 is less than pi
3.1415926 is the value i used for pie
3.1415926 is not an int
Advertisement
3.1415926 is tedious
3.1415926 is a literal
3.1415926 is an f9
3.1415926 is good enough
3.1415926 is good enough for many applications
3.1415926 is the latest
3.1415926 is a constant or numeric literal
3.1415926 is a real number
3.1415926 is a magic number ? pi is a good identifier
3.1415926 is closer to
3.1415926 is less than pi
3.1415926 is the value i used for pie
3.1415926 is not an int
Can''t you just take the atn(4) ? actually it might be atn(8)...
If necessity is the mother of all invention then laziness is the father... and man am I lazy!
It''s 4*atan(1). I''ve used it once, but it made my code longer and harder to read Not everyone knows at first glance that the previous statement is equivalent to PI...
But if you store the value in a variable named pi, then people will know, nor will it make the code harder to read than a hardcoded variable.
Advertisement
quote:
Original post by MatKing
Can''t you just take the atn(4) ? actually it might be atn(8)...


nop it''s 2*atan(infinite)

Visit our homepage: www.rarebyte.de.stGA
quote:
Original post by pawn69
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647


Hey... good approximation!
This could be interesting:

www.hut.fi/~mnippula/votepi.html

As could this:

lcf.www9.50megs.com/pi.html

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
so is there an actual equation to pi (as (1+sqrt(5))/2 is to phi) ? Sounds dumb but deriving the value from really precise and accurate measurements of circumfrence and radius seems awkward. Thanks ahead for curing me of another bit of ignorance!

This topic is closed to new replies.

Advertisement