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

Remove libm dependency #7

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

Conversation

stoeckmann
Copy link

Calculating with floating point precision can be avoided by using power of two and exponents given through command line arguments.

This removes the libm requirement from the resulting binary.

stoeckmann and others added 2 commits May 3, 2023 20:15
The prefix_len must be in a range between 8 and 32 to be useable.
Check the upper bound as well.

Co-authored-by: BenBE <[email protected]>
Signed-off-by: Tobias Stoeckmann <[email protected]>
The number of blocks can be calculated without libm functionality.
Since power of two arguments are passed as command line arguments
we can simply continue calculating with these exponents.

Co-authored-by: BenBE <[email protected]>
Signed-off-by: Tobias Stoeckmann <[email protected]>
config.block_size = 32;
unsigned int block_size_pow = 5;

config.block_size = 1 << block_size_pow;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to initialize block_size here at all? Is it used anywhere before l.423?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick scan through the source showed no places where this field seems to be read in the affected part of the code. Not tested, but it should be safe to drop that assignment in line 215.

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.

3 participants