Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  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. -]>[-]>[-]>>>[>>[<<<<<<<<+>>>>>>>>-]<<-]]>>[-]<<<[-]<<<<<<<<]++++++++++.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement