On Sat, 2024-11-09 at 17:01 -0800, 'simon place' via golang-nuts wrote: > > > That's because Complex numbers are immutable - just like strings, > > and regular numbers for that matter. > > > > Hence to replace one component of a complex number, you have to > > create a new complex number. > > https://go.dev/play/p/Cf06Ui6fR59 > > > > new_imag := 3.0 > > a = complex(real(a), new_imag)
> after all complex numbers are component editable in the problem- > space, and also in the underlying solution-space (hardware) so this > is a nasty intermediate miss-match, seems like a mistake to me. Have you checked to see whether the compiler elides the parts that are not changing a component? From what I can see it does. -- 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. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/964043ab955c3b467aad99919bd4bc13f256999c.camel%40kortschak.io.