Skip to main content
remove excess wording; update grammar, capitalization
Source Link

I wanted to put this as comment but due to reputation restriction i have to add it as an answer.

Though your code is fine, another thing to look is amount of division happening the code, Division is computationally expensive operation and as @Michael has suggested that it is redundant. So always try to minimise the multiplication and division operation in your code.

You have mentioned your self asthat you are a beginner programmer, i. I believe it is a good practice to start familiarising your self with topics like Computational Complexity.

Look here for computational complexity of mathematical functions

I wanted to put this as comment but due to reputation restriction i have to add it as an answer.

Though your code is fine, another thing to look is amount of division happening the code, Division is computationally expensive operation and as @Michael has suggested that it is redundant. So always try to minimise the multiplication and division operation in your code.

You have mentioned your self as a beginner programmer, i believe it is a good practice to start familiarising your self with topics like Computational Complexity.

Look here for computational complexity of mathematical functions

Though your code is fine, another thing to look is amount of division happening the code, Division is computationally expensive operation and as @Michael has suggested that it is redundant. So always try to minimise the multiplication and division operation in your code.

You have mentioned that you are a beginner programmer. I believe it is a good practice to start familiarising your self with topics like Computational Complexity.

Look here for computational complexity of mathematical functions

Post Undeleted by Hemanshu
Post Deleted by Hemanshu
Source Link

I wanted to put this as comment but due to reputation restriction i have to add it as an answer.

Though your code is fine, another thing to look is amount of division happening the code, Division is computationally expensive operation and as @Michael has suggested that it is redundant. So always try to minimise the multiplication and division operation in your code.

You have mentioned your self as a beginner programmer, i believe it is a good practice to start familiarising your self with topics like Computational Complexity.

Look here for computational complexity of mathematical functions