Leibniz formula for pi - Java [closed]
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . So, Leibniz's formula for pi is pi/4 = 1 - 1/3 + 1/5 - 1/7 + 1/9... I can't figure out how to use this formula in Java. I just need some help on how to incorporate the second part into it. I know I need a loop and I need the have a divisor variable, and that it needs plus 2 each time. Thanks for any help. 回答1: