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 <delepl...@gmail.com> 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.

Reply via email to