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

Multiply faster than divide #50

Closed
MalcolmBoura opened this issue Oct 18, 2020 · 1 comment
Closed

Multiply faster than divide #50

MalcolmBoura opened this issue Oct 18, 2020 · 1 comment

Comments

@MalcolmBoura
Copy link
Contributor

In general multiplication is faster than division. The Atmega 328 (and I assume 168) has hardware multiply but not hardware division so multiply is very much faster. I suggest changing calFactor to a multiplier internally.

calFactorRecip = 1 / calFactor;

and then multiply raw values by calFactorRecip.

I may be able to get a pull request done with proposed changes but I don't know when so I will raise this as an issue.

@olkal
Copy link
Owner

olkal commented Oct 19, 2020

Thanks! Included in 1.2.4

@olkal olkal closed this as completed Oct 19, 2020
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

No branches or pull requests

2 participants