[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] COMPLEX Syntax
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] COMPLEX Syntax |
Date: |
Tue, 11 Aug 2015 23:08:54 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Michael Riedl <address@hidden> writes:
> Hallo all,
>
> does someone know if there is a regualr way to update only the real or
> imaginar part of a variable of type LONGCOMPLEX / COMPLEX.
>
> A way to achiev that would be (code segment):
>
> VAR x : COMPLEX;
>
> BEGIN
> x:= ... (and code giving x an initial value)
> ...
> x:=CMPLX("somenewvale",IM(x)); (* for updating the real part only *)
> x:=CMPLX(RE(x),"somenewvalue")); (* for updating the imaginary part
> only *)
>
> But maybe there is another way to do so which I simply do
> not know. But in Fortran it's similar ;-)
>
> Gruß / Regads
>
> Michael
Hi Michael,
I'm not aware of a different mechanism. However on the up side the code
emitted by gm2 should be pretty efficient! Wrapping these lines in a
function is an alternative - and -O3 will allow the compiler to inline
regards,
Gaius