Forum: C Jul 25th, 2008 |
| Replies: 10 Views: 2,146 Hi, this is the algorithm to calculate pi,
Pi = 4-4/3+4/5-4/7+4/9...= 4*((-1)^n+1)/2n-1
It's very similar to your need
#include<stdio.h>
#include<math.h>
int main()
{ |
Forum: C Jul 12th, 2008 |
| Replies: 23 Views: 1,565 This function resave number, if the number is 0 its return true else its return false.
The Boolean " a & 7 ;" says if a != 0 and 7 != 0 then 1 else 0
Has you see the 7 is not needed |