If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Python

Ok, through a vodka induced 'slowness' I've decided this was the proper spot for this question.
I've started to learn PYTHON, at a very beginner stage, this is a completely self taught effort and I will be coming here alot for questions.

this is where I am:

Complex numbers are always represented as two floating point numbers, the real and imaginary part. To extract these parts from a complex number z, use z.real and z.imag.
>>> a=1.5+0.5j
>>> a.real
1.5
>>> a.imag
0.5

and I have to admit, Im so befuddled by this that Im not even sure of my exact question
Really what I need is a complete breakdown of this whole component, if anyone is up for it.
the .real command (is it considered a command or something else?) and the .imag 'command'.

Any and all input is welcome here, as one's two cents might make perfect sense, and anothers
might make just as much sense but the two together might make a
revelation.

And WTF is meant by 'floating point numbers'?

thanx all

Blessings
F

"In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily

.real isn't really considered a command. More of an attribute of the variable that it is used with. When typing in a.real, python (which is a scripting language) outputs the real part of the number a.

Do you have a full conceptual understanding of the imaginary number system?

A floating point variable is one that contains a decimal point that can be anywhere within the variable, hence 'float'. They are usually 4 bytes of resolution, however different languages are different with variable sizes, so that's more of a reference to the classic C/C++ style. However even if your variable is more or less than 4 bytes, it is possible that it still only has 4 bytes of resolution (ie: Java; however in this case, variable are not actually variables and are treated as objects, so they'll take up much more than the 4 bytes of space).

Complex numbers are also supported; imaginary numbers are written with a suffix of j or J. Complex numbers with a nonzero real component are written as (real+imagj), or can be created with the complex(real, imag) function.
>>> 1j * 1J (-1+0j) >>> 1j * complex(0,1) (-1+0j) >>> 3+1j*3 (3+3j) >>> (3+1j)*3 (9+3j) >>> (1+2j)/(1+1j) (1.5+0.5j)

Where do I start?? 'j'/'J' as an imaginary number is not a mathematical variable?

Wow, I really need to go back and study number theory/algebra. Im astounded this makes so little sense to me right now.

I did just get off your wiki link, sir dice, and my mind is just completely rejecting it all right now. Maybe I just gotta try again tomorrow.
That wiki link isn't quite the novice level breakdown that I think I need though. DAMN I FEEL DUMB RIGHT NOW

Last edited by IcSilk; August 14th, 2011 at 05:13 AM.

"In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily

scripting/programming is only easy because it's a completely man made thing that every person has agreed upon the concept of "this does this in my language"...once again, more personal information is needed to asses skill level...the hard part is all that time reading boring details. just guessing.

Last edited by bludgeon; August 14th, 2011 at 05:24 AM.
Reason: I'm from the ass on this one, I'm more bettah with perl...

Yes, the basic idea is that i (or j) is a number, not a variable. It's a bit of a mathematical construct to help solve certain problems.

It resolves around the rule that any number (positive or negative) multiplied by itself gives a positive result. To 'break' that rule they've come up with i. If you multiply i with itself the result is negative. Something that isn't possible with the 'old' rules.

Complex numbers make certain mathematical problems easier to solve.

Oliver's Law:
Experience is something you don't get until just after you need it.