Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What's new in lcc-win

1 view
Skip to first unread message

jacob navia

unread,
Mar 24, 2008, 10:26:07 AM3/24/08
to
What's new in the new version of lcc-win32
------------------------------------------
Mar 24:
When you give the -ansic option, the file complex.h wasn't compiling
correctly. Fixed.
The following standard code:
int operator = (42);
was mistakenly confused with an operator declaration. Fixed.
Incrementing a 64 bit int array would not work correctly. Fixed.
Functions Fresnel, FresnelS and FresnelC were added to the special
functions package.


--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32

Ben Bacarisse

unread,
Mar 24, 2008, 10:35:56 AM3/24/08
to
jacob navia <ja...@nospam.com> writes:

> What's new in the new version of lcc-win32
> ------------------------------------------
> Mar 24:
> When you give the -ansic option, the file complex.h wasn't compiling
> correctly. Fixed.
> The following standard code:
> int operator = (42);
> was mistakenly confused with an operator declaration. Fixed.
> Incrementing a 64 bit int array would not work correctly. Fixed.
> Functions Fresnel, FresnelS and FresnelC were added to the special
> functions package.

You also seem to have fixed the missing definition of _Complex_I and
the types of creal and cimag.

--
Ben.

jacob navia

unread,
Mar 24, 2008, 12:13:37 PM3/24/08
to

Yes, and now, (as a side effect) you can't use
creal(z) = 5;

as you could till yesterday. This is obviously not a standard syntax,
but it was really handy.

The "unofficial" syntax to assign to one part of the
complex number is:

z.re = 5; // assigns to the real part
z.im = 5; // Assigns to the imaginary part

The official syntax is

z = 5 + cimag(z); // Assigns 5 to real part
z = creal(z) + 5*I; // Assigns to the imaginary part.

Ben Bacarisse

unread,
Mar 24, 2008, 12:55:39 PM3/24/08
to
jacob navia <ja...@nospam.com> writes:

> Ben Bacarisse wrote:
<snip>


>> You also seem to have fixed the missing definition of _Complex_I and
>> the types of creal and cimag.
>>
>
> Yes, and now, (as a side effect) you can't use
> creal(z) = 5;

You could always make casts produce modifiable lvalues -- as an
extension.

In the long-run, don't you want to have complex numbers
whose components are the smallest allowable size? I.e. don't you want
float _Complex to use two floats?

> The official syntax is
>
> z = 5 + cimag(z); // Assigns 5 to real part
> z = creal(z) + 5*I; // Assigns to the imaginary part.

I remember doing quote a bit of scientific programming a long time
ago, and modifying the parts of complex number was not a common thing
to do. I may be wrong about that, but I would not worry about it.

--
Ben.

jacob navia

unread,
Mar 24, 2008, 1:27:37 PM3/24/08
to
Ben Bacarisse wrote:
> I remember doing quote a bit of scientific programming a long time
> ago, and modifying the parts of complex number was not a common thing
> to do. I may be wrong about that, but I would not worry about it.

You are in principle correct.

In practic, I see a LOT of code that uses the real and
imaginary parts separate because there wasn't any complex support
until C99. For instance all the code translated from fortran
subroutines in netlib handles the complex parts separately.

0 new messages