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

Template version EWMAT #8

Open
FredM67 opened this issue Jan 23, 2024 · 1 comment
Open

Template version EWMAT #8

FredM67 opened this issue Jan 23, 2024 · 1 comment

Comments

@FredM67
Copy link

FredM67 commented Jan 23, 2024

The argument of non-using float is false.
When you look at the code, there're at least 3 divisions, which are very slow !

@nomakewan
Copy link

Divisions are indeed slow on AVR because they do not have hardware division instructions. However, the existence of a division operation does not promote the variables in that operation to float. Int division just nets a result and remainder, the latter of which is ignored returning a result that is truncated.

As an example, the operation 3 / 2 does not internally utilize a float at any point; it instead internally has a result of 1 and a remainder of 1, and so would return 1 rather than 1.5.

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