Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update math.md, simplifying secondsToRadiant return operation #826

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tuco5
Copy link

@tuco5 tuco5 commented Dec 2, 2024

I want to propose this change to simplify the lecture of the math chapter.

By simplifying the radiant division in the secondsToRadiant and use the parameter as numerator instead of denominator we avoid handling a 0 case type.

Benefits:

  • We can short the chapter removing the zero division error explanation.
  • By dividing the func parameter Is easier to read and we avoid the imprecise floating points
  • If func param is 0 then the return value will be 0 instead of an error.

I hope this helps to simplify the code and the lecture.
Thanks for this great course

Simplify the radiant division in the secondsToRadiant function and use the parameter as numerator to avoid handling a 0 case type.
@tuco5 tuco5 changed the title Update math.md, simple return type, avoid handling zero cases Update math.md, simplifying secondsToRadiant return operation Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant