From 30c3a06de4dd87d8705aae10ef63b5280e49f00a Mon Sep 17 00:00:00 2001 From: Jack Thorne Date: Tue, 4 Jan 2022 17:41:01 -0600 Subject: [PATCH 1/4] Add docs for Complex#zero? --- src/complex.cr | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/complex.cr b/src/complex.cr index 4b6482e9efad..01ebffefd27d 100644 --- a/src/complex.cr +++ b/src/complex.cr @@ -251,6 +251,16 @@ struct Complex new 0, 0 end + # Returns a `true` if the complex number is zero. This means the real and imaginary are both zero. + # + # ``` + # require "complex" + # + # Complex.new(0, 0).zero? # => true + # Complex.new(1, 0).zero? # => false + # Complex.new(0, 1).zero? # => false + # + # ```` def zero? : Bool @real == 0 && @imag == 0 end From 49a61f094b95d2825c6c4d939460dfa475745a8c Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 5 Jan 2022 12:51:37 -0600 Subject: [PATCH 2/4] Update src/complex.cr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Johannes Müller --- src/complex.cr | 1 - 1 file changed, 1 deletion(-) diff --git a/src/complex.cr b/src/complex.cr index 01ebffefd27d..2d4276e60ed3 100644 --- a/src/complex.cr +++ b/src/complex.cr @@ -259,7 +259,6 @@ struct Complex # Complex.new(0, 0).zero? # => true # Complex.new(1, 0).zero? # => false # Complex.new(0, 1).zero? # => false - # # ```` def zero? : Bool @real == 0 && @imag == 0 From b969d15a245d9328c4d8a2f80919e477d711f116 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 5 Jan 2022 12:51:42 -0600 Subject: [PATCH 3/4] Update src/complex.cr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Johannes Müller --- src/complex.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/complex.cr b/src/complex.cr index 2d4276e60ed3..85ce79d991b1 100644 --- a/src/complex.cr +++ b/src/complex.cr @@ -251,7 +251,7 @@ struct Complex new 0, 0 end - # Returns a `true` if the complex number is zero. This means the real and imaginary are both zero. + # Returns `true` if the complex number is zero. This means the real and imaginary are both zero. # # ``` # require "complex" From c1ac8f67524bc7dcfd2c341d5e1fb054565df002 Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 28 Jan 2022 14:42:15 -0600 Subject: [PATCH 4/4] Update src/complex.cr Co-authored-by: Sijawusz Pur Rahnama --- src/complex.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/complex.cr b/src/complex.cr index 85ce79d991b1..e58fe02ac4ae 100644 --- a/src/complex.cr +++ b/src/complex.cr @@ -251,7 +251,8 @@ struct Complex new 0, 0 end - # Returns `true` if the complex number is zero. This means the real and imaginary are both zero. + # Returns `true` if the complex number is zero. + # This means the real and imaginary are both zero. # # ``` # require "complex"