Page 5 of 5
Re:a c question
Posted: Sun Apr 18, 2004 9:13 am
by Candy
Tim Robinson wrote:
Sure, you can use any number as a base.
...
Using a complex number as a base is fun...
You can use complex numbers? What would 0.1 base (3+2i) end up being? I can't figure it out
Re:a c question
Posted: Sun Apr 18, 2004 9:58 am
by Tim
Go back to basic principles. Here's the number 1234 in base 10: (and I've just realised I made a mistake in the last post)
[table][tr][td]Weight[/td][td]10[sup]3[/sup][/td][td]10[sup]2[/sup][/td][td]10[sup]1[/sup][/td][td]10[sup]0[/sup][/td][/tr][tr][td][/td][td]1[/td][td]2[/td][td]3[/td][td]4[/td][/tr][/table]
1234[sub]10[/sub] = 1 * 10[sup]3[/sup] + 2 * 10[sup]2[/sup] + 3 * 10 + 4
(recall that any number raised to the power 0 is 1)
And here's 1234 in base pi:
[table][tr][td]Weight[/td][td]pi[sup]3[/sup][/td][td]pi[sup]2[/sup][/td][td]pi[sup]1[/sup][/td][td]pi[sup]0[/sup][/td][/tr][tr][td][/td][td]1[/td][td]2[/td][td]3[/td][td]4[/td][/tr][/table]
1234[sub]pi[/sub] = 1 * pi[sup]3[/sup] + 2 * pi[sup]2[/sup] + 3 * pi + 4
And here's 1234 in base 3+2i:
[table][tr][td]Weight[/td][td](3+2i)[sup]3[/sup][/td][td](3+2i)[sup]2[/sup][/td][td](3+2i)[sup]1[/sup][/td][td](3+2i)[sup]0[/sup][/td][/tr][tr][td][/td][td]1[/td][td]2[/td][td]3[/td][td]4[/td][/tr][/table]
1234[sub]3+2i[/sub] = 1 * (3+2i)[sup]3[/sup] + 2 * (3+2i)[sup]2[/sup] + 3 * (3+2i) + 4
It is left as an exercise to the reader to evaluate all these numbers in decimal.
Re:a c question
Posted: Sun Apr 18, 2004 10:16 am
by Candy
Tim Robinson wrote:
And here's 1234 in base 3+2i:
[table][tr][td]Weight[/td][td](3+2i)[sup]3[/sup][/td][td](3+2i)[sup]2[/sup][/td][td](3+2i)[sup]1[/sup][/td][td](3+2i)[sup]0[/sup][/td][/tr][tr][td][/td][td]1[/td][td]2[/td][td]3[/td][td]4[/td][/tr][/table]
1234[sub]3+2i[/sub] = 1 * (3+2i)[sup]3[/sup] + 2 * (3+2i)[sup]2[/sup] + 3 * (3+2i) + 4
The point was rewriting 1/(3+2i) to something more sensible. Can that be done?
Re:a c question
Posted: Sun Apr 18, 2004 10:54 am
by Tim
Good point -- yes, it can. If I can just remember first year undergraduate maths...
It's [table][tr][td]3-2i[/td][/tr][tr][td][hr][/td][/tr][tr][td]13[/td][/tr][/table].
[table][tr][td][table][tr][td]1[/td][/tr][tr][td][hr][/td][/tr][tr][td]3+2i[/td][/tr][/table][/td] = [td][table][tr][td]1 * (3-2i)[/td][/tr][tr][td][hr][/td][/tr][tr][td](3+2i)(3-2i)[/td][/tr][/table][/td] = [td][table][tr][td]3-2i[/td][/tr][tr][td][hr][/td][/tr][tr][td]9+4[/td][/tr][/table][/td][/tr][/table]
And at this point I've broken the board HTML by overuse of YaBB tables, so I think I'll stop.
Re:a c question
Posted: Fri May 14, 2004 12:05 pm
by Neo
what is the use of the COMMENTS section in an object file?
Re:a c question
Posted: Mon May 17, 2004 12:33 pm
by Tim
Why are you adding to an old for an unrelated question? Please start a new thread.
To answer your question: there isn't any as far as I'm aware.
Re:a c question
Posted: Tue May 18, 2004 11:47 am
by Neo
Sorry about that. Thought it would be easier to follow for 'C'eekers if I kept 'em all in the same place.
Guess it won't