Logo

Programming-Idioms

History of Idiom 77 > diff from v1 to v2

Edit summary for version 2 by :

Version 1

2015-08-24, 16:09:24

Version 2

2015-08-24, 16:10:07

Idiom #77 Complex number

Declare a complex x and initialize it with value (3i - 2). Then multiply it by i.

Idiom #77 Complex number

Declare a complex x and initialize it with value (3i - 2). Then multiply it by i.

Code
x := 3i - 2
x *= 1i
Code
x := 3i - 2
x *= 1i
Comments bubble
complex128 is a built-in type.

1i denotes the imaginary unit i.
Comments bubble
complex128 is a built-in type.

1i denotes the imaginary unit i.
Doc URL
https://golang.org/ref/spec#Numeric_types
Doc URL
https://golang.org/ref/spec#Numeric_types
Demo URL
http://play.golang.org/p/N7f0UYp0Hl
Demo URL
http://play.golang.org/p/aWVjAibhJZ