3 added 40 characters in body
source | link

The source of pi

Inspired by an International Obfuscated C Code Contest entry.

Task

As you all know, pi is a constant that represents the ratio of a circle's circumference to its diameter.

Using the dimensions of your own source code, approximate pi to at least two decimal places.

That is, your source code should read itself to obtain both circumference and diameter, then output the ratio.

For example, if your code is:

 AB
CDEF
 GH

Your circumference is 14 and your diameter is 4.

For the purposes of this challenge, let diameter equal the larger of the height or width of your code.

Rules

  • Take no input
  • Hardcoded values for pi are not allowed
  • Output should bepi to at least two decimal places (e.g., 3.14 with optional trailing new lineand 3.1415 are both acceptable outputs)
  • Answers can be either whole programs or functions.

Notes

Answers with higher precision values are acceptable.

Standard rules apply.


Meta

Looking for suggestions of a better title.

The source of pi

Inspired by an International Obfuscated C Code Contest entry.

Task

As you all know, pi is a constant that represents the ratio of a circle's circumference to its diameter.

Using the dimensions of your own source code, approximate pi to at least two decimal places.

That is, your source code should read itself to obtain both circumference and diameter, then output the ratio.

For example, if your code is:

 AB
CDEF
 GH

Your circumference is 14 and your diameter is 4.

For the purposes of this challenge, let diameter equal the larger of the height or width of your code.

Rules

  • Take no input
  • Hardcoded values for pi are not allowed
  • Output should be 3.14 with optional trailing new line
  • Answers can be either whole programs or functions.

Notes

Answers with higher precision values are acceptable.

Standard rules apply.


Meta

Looking for suggestions of a better title.

The source of pi

Inspired by an International Obfuscated C Code Contest entry.

Task

As you all know, pi is a constant that represents the ratio of a circle's circumference to its diameter.

Using the dimensions of your own source code, approximate pi to at least two decimal places.

That is, your source code should read itself to obtain both circumference and diameter, then output the ratio.

For example, if your code is:

 AB
CDEF
 GH

Your circumference is 14 and your diameter is 4.

For the purposes of this challenge, let diameter equal the larger of the height or width of your code.

Rules

  • Take no input
  • Hardcoded values for pi are not allowed
  • Output pi to at least two decimal places (e.g., 3.14 and 3.1415 are both acceptable outputs)
  • Answers can be either whole programs or functions

Notes

Answers with higher precision values are acceptable.

Standard rules apply.


Meta

Looking for suggestions of a better title.

2 specification updates
source | link

The source of pi

Inspired by an International Obfuscated C Code Contest entry.

Task

As you all know, pi is a constant that represents the ratio of a circle's circumference to its diameter.

Using the areadimensions of your own source code, approximate pi to at least two decimal places.

That is, your source code should read itself to obtain both circumference and diameter, then output the ratio.

For example, if your code is:

 AB
CDEF
 GH

Your circumference is 14 and your diameter is 4.

For the purposes of this challenge, let diameter equal the larger of the height or width of your code.

Rules

  • Take no input
  • Hardcoded values for pi are not allowed
  • Output should be 3.14 with optional trailing new line
  • Answers can be either whole programs or functions.

Notes

Answers with higher precision values are acceptable.

Standard rules apply.


Meta

Looking for suggestions of a better title.

The source of pi

Inspired by an International Obfuscated C Code Contest entry.

Task

Using the area of your own source code, approximate pi to at least two decimal places.

Rules

  • Take no input
  • Hardcoded values for pi are not allowed
  • Output should be 3.14 with optional trailing new line

Standard rules apply.


Meta

Looking for suggestions of a better title.

The source of pi

Inspired by an International Obfuscated C Code Contest entry.

Task

As you all know, pi is a constant that represents the ratio of a circle's circumference to its diameter.

Using the dimensions of your own source code, approximate pi to at least two decimal places.

That is, your source code should read itself to obtain both circumference and diameter, then output the ratio.

For example, if your code is:

 AB
CDEF
 GH

Your circumference is 14 and your diameter is 4.

For the purposes of this challenge, let diameter equal the larger of the height or width of your code.

Rules

  • Take no input
  • Hardcoded values for pi are not allowed
  • Output should be 3.14 with optional trailing new line
  • Answers can be either whole programs or functions.

Notes

Answers with higher precision values are acceptable.

Standard rules apply.


Meta

Looking for suggestions of a better title.

1
source | link

The source of pi

Inspired by an International Obfuscated C Code Contest entry.

Task

Using the area of your own source code, approximate pi to at least two decimal places.

Rules

  • Take no input
  • Hardcoded values for pi are not allowed
  • Output should be 3.14 with optional trailing new line

Standard rules apply.


Meta

Looking for suggestions of a better title.