Re: [go-nuts] Change imaginary part of a complex

2017-04-27 Thread Val
Thank you Thomas for insight!

On Thursday, April 20, 2017 at 10:21:23 PM UTC+2, Thomas Bushnell, BSG 
wrote:
>
> The other way is to add the c to its conjugate and then add the imaginary 
> part, using cmplx.Conj. But that really amounts to what you're doing 
> already.
>
> On Thu, Apr 20, 2017 at 3:20 AM Val  
> wrote:
>
>> Hello folks
>> To keep real part of a complex, and set its imag part, I'm doing
>>   c = complex(real(c), -5.0)
>>
>> Is there a more concise way, something like   c.imag = -5.0  ? I know 
>> this one doesn't compile, but I may be missing something obvious.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Change imaginary part of a complex

2017-04-20 Thread Michael Jones
It would be natural if real(c) and imag(c) were lvalues

On Thu, Apr 20, 2017 at 1:21 PM 'Thomas Bushnell, BSG' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> The other way is to add the c to its conjugate and then add the imaginary
> part, using cmplx.Conj. But that really amounts to what you're doing
> already.
>
> On Thu, Apr 20, 2017 at 3:20 AM Val  wrote:
>
>> Hello folks
>> To keep real part of a complex, and set its imag part, I'm doing
>>   c = complex(real(c), -5.0)
>>
>> Is there a more concise way, something like   c.imag = -5.0  ? I know
>> this one doesn't compile, but I may be missing something obvious.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Michael T. Jones
michael.jo...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Change imaginary part of a complex

2017-04-20 Thread 'Thomas Bushnell, BSG' via golang-nuts
The other way is to add the c to its conjugate and then add the imaginary
part, using cmplx.Conj. But that really amounts to what you're doing
already.

On Thu, Apr 20, 2017 at 3:20 AM Val  wrote:

> Hello folks
> To keep real part of a complex, and set its imag part, I'm doing
>   c = complex(real(c), -5.0)
>
> Is there a more concise way, something like   c.imag = -5.0  ? I know
> this one doesn't compile, but I may be missing something obvious.
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Change imaginary part of a complex

2017-04-20 Thread Val
Hello folks
To keep real part of a complex, and set its imag part, I'm doing
  c = complex(real(c), -5.0)

Is there a more concise way, something like   c.imag = -5.0  ? I know this 
one doesn't compile, but I may be missing something obvious.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.