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

Clarification of "magic" constants #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jneb
Copy link

@jneb jneb commented Sep 5, 2023

When trying to understand the code, I had a hard time figuring out where the constants came from.
I didn't opt for actually producing the constants at compile time, but I did add comments to explain to future readers why they are there.

jneb added 2 commits September 4, 2023 16:49
At least one constant is more legible now
@jneb
Copy link
Author

jneb commented Sep 5, 2023

(I was talking about the constants use for the bin2dec conversion, of course)
I also updated the AXV512 version.

@Mysticial
Copy link
Owner

The division methods here (including the magic constants) were taken from what a compiler generates when you divide by 10, 100, 10000, etc...

I don't remember which compiler it's from since it's been a long time. They probably all generate the same thing.

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.

2 participants