_Complex and _Imaginary datatypes
Andrew Pinski
pinskia@physics.uc.edu
Mon Feb 24 06:54:00 GMT 2003
I just want to voice my opinion now since no one has mentioned Fortran
yet.
I would say C is evolving past what C++ is and more into Fortran.
Fortran includes complex types so if people want to use C has a good
scientific language,
you need complex types included in the language, having it in a library
some times does
not help because certain concepts you would need to write out like add
but since C does
have overloading functions (they have types based functions for math
though, in C99) it
is very hard to do that.
For an example:
double a; ComplexDouble b;
ComplexDouble c;
ComplexDouble d;
Right now:
c = b+a;
d = c - _Imaginary * 2.0;
Your proposal (yes the parser is simpler):
ComplexDouble temp;
c = addComplexDoubleToDouble(b,a);
temp = makeComplexDouble(0, 2.0);
d = addComplexDoubleToComplexDouble(b,temp);
Thanks,
Andrew Pinski
On Sunday, Feb 23, 2003, at 19:04 US/Pacific, Justin Hibbits wrote:
> You know what? Just forget what I suggested. Apparently I'm the only
> member
> of the minority who believes C shouldn't change to be C++, which it
> seems to be
> doing. So, from now on, I'll just keep my mouth shut. Nobody cares
> what I
> think, as apparently I'm just a fucking troll.
>
> --
> Registered Linux user 260206
>
>
>
>
More information about the Gcc
mailing list