Skip to content

. - #5116

Closed
ea-ae wants to merge 0 commit into
TheAlgorithms:masterfrom
ea-ae:hacktoberfest
Closed

.#5116
ea-ae wants to merge 0 commit into
TheAlgorithms:masterfrom
ea-ae:hacktoberfest

Conversation

@ea-ae

@ea-ae ea-ae commented Oct 7, 2021 •

Copy link
Copy Markdown

No description provided.

@ghost ghost added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files labels Oct 7, 2021
Comment thread fractals/mandelbrot.py Outdated
a_new = a * a - b * b + x
b = 2 * a * b + y
a = a_new
a, b = a ** 2 - b ** 2 + x, \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backslash line continuation is not recommended in PEP8.

Comment thread fractals/mandelbrot.py Outdated
Comment on lines +61 to +63
return 0, 0, 0
else:
return (255, 255, 255)
return 255, 255, 255

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this an improvement?

Comment thread fractals/mandelbrot.py Outdated
# greater than 4
if a * a + b * b > 4:
# divergence happens for all complex numbers with an absolute value greater than 4
if a ** 2 + b ** 2 > 4:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this faster or slower? Please prove that with timeit tests. https://docs.python.org/3/library/timeit.html

@ghost ghost added the tests are failing Do not merge until tests pass label Oct 10, 2021
@ea-ae ea-ae closed this Oct 10, 2021
@ea-ae ea-ae changed the title Improve Mandelbrot set algorithm style Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files tests are failing Do not merge until tests pass

2 participants