This challenge involves the mathematical constant pi.

learn more… | top users | synonyms

-2
votes
5answers
859 views

Calculate the most digits of pi [closed]

There are a lot of challenges on this site regarding pi, but none that challenge you to calculate as many digits of pi as possible. As you all may know, pi in its decimal form goes on for infinity, ...
-3
votes
0answers
160 views

Calculate pi - I mean e [duplicate]

Write a program which appears to calculate pi, but which actually calculates e. The program must actually calculate; it can not load from another file, library constants, or the Internet. (Built-in ...
13
votes
6answers
758 views

PI window encryption

This is a simple encryption method that uses PI digits to encode a message, the method is simple: The key is just a positive integer that indicates where the window starts then: Given a string to ...
21
votes
8answers
7k views

Pi is still wrong

Pi is Wrong A common method of computing pi is by throwing "darts" into a 1x1 box and seeing which land in the unit circle compared to the total thrown: loop x = rand() y = rand() ...
45
votes
65answers
14k views

Output Pi without math

In as few bytes as possible, your job is to write a program that outputs: 3.14 In celebration of a late Pi day of course! :) Rules You can do it anyway you like, but there are some restrictions. ...
48
votes
43answers
7k views

π Day puzzle for 3/14

Happy π Day. The goal of this question is to calculate the area for a circle of radius 3, where A = πr². The catch is that you have to use the constant π that is defined in a different language ...
2
votes
2answers
352 views

Get as close to pi as you can [closed]

Your job is to write a program to find the closest number to PI. Let me clarify. You will first choose a number type. Let us say you choose Integer (in an actual answer, you cannot). Your program ...
13
votes
62answers
5k views

Pi Calculation Code Golf

The Challenge You must calculate pi in the shortest length you can. Any language is welcome to join and you can use any formula to calculate pi. It must be able to calculate pi to at least 5 decimal ...
12
votes
10answers
1k views

stupid restrictions and desert

So, you were sitting at your desk, golfing a program to calculate the first 20 digits of pi, and along comes your boss and throws your apple IIe out the window. You are now working on a new project ...
4
votes
3answers
696 views

Solve the CodeSprint4 Leibniz code golf challenge in Python in 66 characters

Check out this challenge: https://www.hackerrank.com/codesprint4/challenges/leibniz (The competition has already ended, so I'm just curious about the Python solution, which the organizers refused to ...
12
votes
22answers
3k views

Calculate pi to 5 decimals

This comes from http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/ "Given that Pi can be estimated using the function 4 * (1 – 1/3 + 1/5 – 1/7 + …) with more terms ...
16
votes
11answers
1k views

Good rational approximations of pi

Write a program that prints out all the good rational approximations of pi with denominator < 1000000, in increasing denominator order. a/b is a "good rational approximation" of pi if it is closer ...
11
votes
8answers
2k views

Calculate digits of Pi

This is a somewhat different task. Calculate1024 hexadecimal digits of pi, beginning at the 1024th hexadecimal place. Formally: Your program should complete in less then 1 minute and produce the ...
15
votes
7answers
1k views

Calculate 500 digits of pi

Write a program to calculate the first 500 digits of pi, meeting the rules below: It must be less than 500 characters in length. It cannot include "pi", "math.pi" or similar pi constants, nor may it ...