Author Topic: Happy Pi Day!  (Read 3490 times)

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
Re: Happy Pi Day!
« Reply #25 on: March 15, 2013, 04:20:17 PM »
I use that when I'm doing my moon shuttle gig.  It helps cut down on the course corrections.

 =D

It's one of those things you need as a programmer if you find yourself working on a small system (like embedded stuff) where the cost of implemented floating point math is just too great, either in extra circuitry or in extra memory.  Under conditions where the programmer is confined to using fixed-point (scaled integer) math, calculations involving transcendental numbers can still be done using integer multiply/divide sequences.  Need the area for a circle?  Have radius?  It's a simple matter to perform the integer multiplication:  V = R x R x 355, and then the integer divide A = V / 113.

People using computers running modern CPUs and floating-point co-processors don't worry about stuff like this.  People writing for 8-bit and 16-bit embedded processors have to pay attention to these things.

Yes, there are still systems that use low-end (inexpensive) processors, and you'd be amazed at the performance you can get from an 8051 or 6809 running at 12MHz if it's not running Windows or some other heavyweight OS.

#define pi 355/113;

 :cool:


Yeah, a lot of people don't realize that many aircraft systems are still 8 or 16 bit.
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin

seeker_two

  • friend
  • Senior Member
  • ***
  • Posts: 12,922
  • In short, most intelligence is false.
Re: Happy Pi Day!
« Reply #26 on: March 15, 2013, 11:11:15 PM »
Yesterday, I ate cake.....

Today, I ate pie.....


.....I don't like people telling me when I can eat pie.....
Impressed yet befogged, they grasped at his vivid leading phrases, seeing only their surface meaning, and missing the deeper current of his thought.

Phantom Warrior

  • friend
  • Senior Member
  • ***
  • Posts: 926
Re: Happy Pi Day!
« Reply #27 on: March 16, 2013, 01:55:08 AM »
*Goes to white board*

*Writes*

Pairs of first three odd numbers
...113355
Split into two three-digit groups
...113 _ 355
Swap the two groups, like so
...355 _ 113
Write as ratio
...355/113
Enjoy six digits of accuracy
...3.14159292
[Real pi]
...3.14159265359

Many years ago (like 1983 or 1984) I read one of the FORTH programming books, which had a cool table of rational approximations of various useful constants (like e, pi, and so on), and this very compact "rational pi" was one of them.

The next rational approximation which is more accurate involves memorizing two 5-digit numbers having no apparent relation to one another.  The 113355 --> 113 355 --> 355 113 --> 355/113 sequence is an easy mnemonic, so in my book it's a keeper.

Enjoy.

This is literally one of the best things I've seen in a while.  It is now my Facebook status and I definitely told people about it today.

Boomhauer

  • Former Moderator, fired for embezzlement and abuse of power
  • friends
  • Senior Member
  • ***
  • Posts: 14,336
Re: Happy Pi Day!
« Reply #28 on: March 16, 2013, 07:30:50 AM »
This is literally one of the best things I've seen in a while.  It is now my Facebook status and I definitely told people about it today.

Do people just look at you when you tell them stuff like that, nod and slowly back away?
Quote from: Ben
Holy hell. It's like giving a loaded gun to a chimpanzee...

Quote from: bluestarlizzard
the last thing you need is rabies. You're already angry enough as it is.

OTOH, there wouldn't be a tweeker left in Georgia...

Quote from: Balog
BLOOD FOR THE BLOOD GOD! SKULLS FOR THE SKULL THRONE! AND THROW SOME STEAK ON THE GRILL!

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
Re: Happy Pi Day!
« Reply #29 on: March 16, 2013, 11:18:34 AM »
Do people just look at you when you tell them stuff like that, nod and slowly back away?

That sounds like a good technique to me  >:D
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin

MrsSmith

  • I do declare, someone needs an ass whoopin'
  • friend
  • Senior Member
  • ***
  • Posts: 2,734
Re: Happy Pi Day!
« Reply #30 on: March 20, 2013, 09:15:35 PM »
My eyes glazed over by the time I got to "Enjoy six digits of accuracy ...."
America is at that awkward stage; It's too late to work within the system, but too early to shoot the bastards. ~ Claire Wolfe

Boomhauer

  • Former Moderator, fired for embezzlement and abuse of power
  • friends
  • Senior Member
  • ***
  • Posts: 14,336
Re: Happy Pi Day!
« Reply #31 on: March 20, 2013, 09:17:07 PM »
Hey jackwagons, I got pie today! Sweet tater pie.
Quote from: Ben
Holy hell. It's like giving a loaded gun to a chimpanzee...

Quote from: bluestarlizzard
the last thing you need is rabies. You're already angry enough as it is.

OTOH, there wouldn't be a tweeker left in Georgia...

Quote from: Balog
BLOOD FOR THE BLOOD GOD! SKULLS FOR THE SKULL THRONE! AND THROW SOME STEAK ON THE GRILL!

lupinus

  • Southern Mod Trimutive Emeritus
  • friends
  • Senior Member
  • ***
  • Posts: 9,178
Re: Happy Pi Day!
« Reply #32 on: March 20, 2013, 09:34:53 PM »
Hey jackwagons, I got pie today! Sweet tater pie.
Mmmm sweet taters pie.

That is all. *expletive deleted*ck you all, eat *expletive deleted*it, and die in a fire. I have considered writing here a long parting section dedicated to each poster, but I have decided, at length, against it. *expletive deleted*ck you all and Hail Satan.

Fly320s

  • friend
  • Senior Member
  • ***
  • Posts: 14,415
  • Formerly, Arthur, King of the Britons
Re: Happy Pi Day!
« Reply #33 on: March 21, 2013, 07:51:58 AM »
#define pi 355/113;

 :cool:


Yeah, a lot of people don't realize that many aircraft systems are still 8 or 16 bit.

I think the Airbus is 4 bit. And that is on a good day.
Islamic sex dolls.  Do they blow themselves up?

Scout26

  • I'm a leaf on the wind.
  • friend
  • Senior Member
  • ***
  • Posts: 25,997
  • I spent a week in that town one night....
Re: Happy Pi Day!
« Reply #34 on: March 21, 2013, 08:49:59 AM »
We had harvest apple pie last night.  :P
Some days even my lucky rocketship underpants won't help.


Bring me my Broadsword and a clear understanding.
Get up to the roundhouse on the cliff-top standing.
Take women and children and bed them down.
Bless with a hard heart those that stand with me.
Bless the women and children who firm our hands.
Put our backs to the north wind.
Hold fast by the river.
Sweet memories to drive us on,
for the motherland.

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
Re: Happy Pi Day!
« Reply #35 on: March 21, 2013, 10:41:17 AM »
I think the Airbus is 4 bit. And that is on a good day.

If I recall correctly from working on the A400, the ARINC system is 32 bit, which as you probably know actually only contains about 16 bits of data.  The rest is labeling, parity, etc.
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin