Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Remove use of float and math.h#125

Merged
JLErvin merged 5 commits intoJLErvin:masterfrommsharov:master
Mar 25, 2021
Merged

Remove use of float and math.h#125

JLErvin merged 5 commits intoJLErvin:masterfrommsharov:master
Mar 25, 2021

Conversation

msharov
Copy link
Contributor

euclidean_distance and round_k in utils.c use pow and ceil functions from math.h, resulting in int to float to int conversions and an unnecessary dependency on libm. These commits rewrite them using only integer math, move them to wm.c, and make them static for inlining because they are only used there.

The build system places .o files and the executables into .o/ subdir,so it is not necessary to have explicit .gitignore rules for them.
Using pow to square an integer is inappropriate; it results inconversion of integers to and from floats, and a dependency on libm.
Using ceil results in int to float to int conversions and an unnecessarylibm dependency. Also, rename to ceil10 because it rounds up to next 10.Move to wm.c and make static because it is not used anywhere else.
@JLErvin
Copy link
Owner

Looks all good to me after some testing. Thanks for including the.gitignore reversion as well :)

@JLErvinJLErvin merged commit05c2465 intoJLErvin:masterMar 25, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@msharov@JLErvin

[8]ページ先頭

©2009-2025 Movatter.jp