Can+~
March 20th, 2008, 09:08 PM
I was given this "bonus" task at university, about building home-made complex numbers. So far so good, I could do everything on the task (sum and multiplication).
Now I'm wondering, if it's possible that I could do something like, building my own operators for this struct, like "complex a + complex b".
typedef struct
{
float r,i;
}complex;
// blah blah...
complex a, b;
//the user fills a and b with something like:
// a = 2+3i
// b = 4-6i
c = a + b
//And c should be 6-3i
C is kinda awkward after months with python+gtk.
PD: The task is finished, it could be sent right now, but I'm wondering if this is possible.
Now I'm wondering, if it's possible that I could do something like, building my own operators for this struct, like "complex a + complex b".
typedef struct
{
float r,i;
}complex;
// blah blah...
complex a, b;
//the user fills a and b with something like:
// a = 2+3i
// b = 4-6i
c = a + b
//And c should be 6-3i
C is kinda awkward after months with python+gtk.
PD: The task is finished, it could be sent right now, but I'm wondering if this is possible.