sysy/performance_c/input/brainfuck-pi-nerf.in

28 lines
1.2 KiB
Plaintext
Raw Normal View History

2024-04-14 22:20:29 +08:00
[ yet another pi calculation program in bf
Just like for pi16.b the accuracy of the result depends on the cellsize:
- using 8 bit cells causes an overflow after 4 digits
- using 16 bit cells causes an overflow after 537 digits
- using 32 bit cells causes an overflow after several millions of digits
It's about ~38 times shorter than pi16.b, ~364 times faster and works with
not-wrapping (bignum) implementations.
by Felix Nawothnig (felix.nawothnig@t-online.de) ]
>
+++++ +++++ +++++ +++++
+++++ +++++ +++++ +++++
(40 digits)
[<+>>>>>>>>++++++++++<<<<<<<-]>+++++[<+++++++++>-]+>>>>>>+[<<+++[>>[-<]<[>]<-]>>
[>+>]<[<]>]>[[->>>>+<<<<]>>>+++>-]<[<<<<]<<<<<<<<+[->>>>>>>>>>>>[<+[->>>>+<<<<]>
>>>>]<<<<[>>>>>[<<<<+>>>>-]<<<<<-[<<++++++++++>>-]>>>[<<[<+<<+>>>-]<[>+<-]<++<<+
>>>>>>-]<<[-]<<-<[->>+<-[>>>]>[[<+>-]>+>>]<<<<<]>[-]>+<<<-[>>+<<-]<]<<<<+>>>>>>>
>[-]>[<<<+>>>-]<<++++++++++<[->>+<-[>>>]>[[<+>-]>+>>]<<<<<]>[-]>+>[<<+<+>>>-]<<<
<+<+>>[-[-[-[-[-[-[-[-[-<->[-<+<->>]]]]]]]]]]<[+++++[<<<++++++++<++++++++>>>>-]<
<<<+<->>>>[>+<<<+++++++++<->>>-]<<<<<[>>+<<-]+<[->-<]>[>>.<<<<[+.[-]]>>-]>[>>.<<
-]>[-]>[-]>>>[>>[<<<<<<<<+>>>>>>>>-]<<-]]>>[-]<<<[-]<<<<<<<<]++++++++++.
#