A special day just for all us techie types.
Today is also sum day. ( 3 + 14 = 17 ) So, if you have something you've been putting off till sum day, git er done.
Ced
![](https://www.embeddedrelated.com/new/images/defaultavatar.jpg)
Can't remember PI? Write out the first three odd digits twice, as: 113355 Now, divide the first three digits into the last three digits like you did in grade school. Amazingly accurate.
![](https://www.embeddedrelated.com/new/images/defaultavatar.jpg)
Nice! The first 7 digits are correct, indeed.
![](https://d23s79tivgl8me.cloudfront.net/user/profilepictures/37480.jpg)
you missed (2 + 15 = 17), (1 +16 = 17) ...
![](https://d23s79tivgl8me.cloudfront.net/user/profilepictures/103185.jpg)
I should have said "a sum day". Yep, we get one every month for quite a few years yet. However, today is especially special because it is the only Pi day that will fall on sum day in this century. Time to celebrate!
Regards,
Ced
![](https://www.embeddedrelated.com/new/images/defaultavatar.jpg)
Here's a cool way to define PI in a C program. Instead of saying
#define PI 3.14159265
do this:
#define PI 4 * atan(1)
It computes Pi at compile time with maximum accuracy.
![](https://d23s79tivgl8me.cloudfront.net/user/profilepictures/103185.jpg)
That's a good hint, but you want to wrap another set of parentheses around it like this:
#define PI ( 4 * atan(1) )
Otherwise statements like this will not give you the results you desire:
Factor = N / PI;
In Linux, M_PI is available from the Math library.
Ced
![](https://www.embeddedrelated.com/new/images/defaultavatar.jpg)
Good point.