473,495 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Definition of '1j'?

Hi,

I'm wondering how/where the syntax for, e.g., 1j is defined. Is it
something I can define myself? In particular, I make very heavy use of
a complex unit other than j (I'll call it 1k=exp(pi*1j/3)), and it
would be terribly convenient to make my own complex class based on this
unit, which would construct and display results in this form, i.e.
>>(1+2k)*1k
-2+3k

It's not a terrible inconvenience if this is not possble, since I can
just define K=mycomplex(0,1), but I really do like the 1j notation, and
the problem with the other notation is that K could easily get
overwritten (and thus suggests I need a better name), while 1k would
take intention to mess up.

Thanks,
--
Steve Hicks

Oct 5 '06 #1
2 2722
st**********@gmail.com wrote:

I'm wondering how/where the syntax for, e.g., 1j is defined.
http://docs.python.org/ref/imaginary.html

</F>

Oct 5 '06 #2
At Wednesday 4/10/2006 21:43, st**********@gmail.com wrote:
>I'm wondering how/where the syntax for, e.g., 1j is defined. Is it
something I can define myself? In particular, I make very heavy use of
Nope - it's hardcoded inside the parser (see tokenizer.c)
>a complex unit other than j (I'll call it 1k=exp(pi*1j/3)), and it
would be terribly convenient to make my own complex class based on this
unit, which would construct and display results in this form, i.e.
>(1+2k)*1k
-2+3k

It's not a terrible inconvenience if this is not possble, since I can
just define K=mycomplex(0,1), but I really do like the 1j notation, and
the problem with the other notation is that K could easily get
overwritten (and thus suggests I need a better name), while 1k would
take intention to mess up.
For a thing like 3k to be recognized as a complex number I'm afraid
the only option would be to modify the Python sources.

Gabriel Genellina
Softlab SRL

__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas

Oct 5 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3732
by: Dave H | last post by:
Hello, I have a query regarding definition lists. Is it good practice semantically to use the dt and dd elements to mark up questions and answers in a frequently asked questions list, or FAQ? ...
7
4223
by: Neil Zanella | last post by:
Hello, I have posted the following message before but got no replies... I am trying to format an HTML definition list with CSS so that it appears as follows, but am having the following problem:...
14
2839
by: Mike Hewson | last post by:
Have been researching as to why: <example 1> class ABC { static const float some_float = 3.3f; }; <end example 1>
19
2867
by: J. J. Farrell | last post by:
After many years of dealing with definition and linkage issues in ways that I know to be safe, I've decided it's time to try to understand this area properly. Consider a header file with the file...
4
25362
by: Ced | last post by:
Hi, i'm not an expert in C but i try to compile BTNG software under linux kernel 2.4.2-2. I get these errors at the very first stage. Does someone could have a rapid look on this and tell me...
10
20830
by: Kobu | last post by:
My question is about the use and meaning of the terms "declaration" and "definition" as it pertains to the C language. I've read sources that mix the two up when talking about such things as...
9
8860
by: Jess | last post by:
Hello, I was told that if I declare a static class constant like this: class A{ static const int x = 10; }; then the above statement is a declaration rather than a definition. As I've...
15
14887
by: vaib | last post by:
hi to all.i'd like to know the actual difference between variable declaration and definition.it would be very helpful if anyone out there wud help me out with this thing.i'm writing here after here...
275
12024
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
7120
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.