Line | |
---|
1 | [ yet another pi calculation program in bf
|
---|
2 |
|
---|
3 | Just like for pi16.b the accuracy of the result depends on the cellsize:
|
---|
4 |
|
---|
5 | - using 8 bit cells causes an overflow after 4 digits
|
---|
6 | - using 16 bit cells causes an overflow after 537 digits
|
---|
7 | - using 32 bit cells causes an overflow after several millions of digits
|
---|
8 |
|
---|
9 | It's about ~38 times shorter than pi16.b, ~364 times faster and works with
|
---|
10 | not-wrapping (bignum) implementations.
|
---|
11 |
|
---|
12 | by Felix Nawothnig (felix.nawothnig@t-online.de) ]
|
---|
13 |
|
---|
14 | > +++++ +++++ +++++ (15 digits)
|
---|
15 |
|
---|
16 | [<+>>>>>>>>++++++++++<<<<<<<-]>+++++[<+++++++++>-]+>>>>>>+[<<+++[>>[-<]<[>]<-]>>
|
---|
17 | [>+>]<[<]>]>[[->>>>+<<<<]>>>+++>-]<[<<<<]<<<<<<<<+[->>>>>>>>>>>>[<+[->>>>+<<<<]>
|
---|
18 | >>>>]<<<<[>>>>>[<<<<+>>>>-]<<<<<-[<<++++++++++>>-]>>>[<<[<+<<+>>>-]<[>+<-]<++<<+
|
---|
19 | >>>>>>-]<<[-]<<-<[->>+<-[>>>]>[[<+>-]>+>>]<<<<<]>[-]>+<<<-[>>+<<-]<]<<<<+>>>>>>>
|
---|
20 | >[-]>[<<<+>>>-]<<++++++++++<[->>+<-[>>>]>[[<+>-]>+>>]<<<<<]>[-]>+>[<<+<+>>>-]<<<
|
---|
21 | <+<+>>[-[-[-[-[-[-[-[-[-<->[-<+<->>]]]]]]]]]]<[+++++[<<<++++++++<++++++++>>>>-]<
|
---|
22 | <<<+<->>>>[>+<<<+++++++++<->>>-]<<<<<[>>+<<-]+<[->-<]>[>>.<<<<[+.[-]]>>-]>[>>.<<
|
---|
23 | -]>[-]>[-]>>>[>>[<<<<<<<<+>>>>>>>>-]<<-]]>>[-]<<<[-]<<<<<<<<]++++++++++.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.