-
Notifications
You must be signed in to change notification settings - Fork 290
Remove dependency to the math library. #103
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
base: master
Are you sure you want to change the base?
Remove dependency to the math library. #103
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a compile option, as people who are already linking the math library anyway might want the reduced code size of using the existing pow function, or they may even wish to provide their own version of the function. Having the ability to not need the math library is appreciated though!
I will add compilation directives for this. How about using JSON_INTERNAL_MATH to actively remove the dependency? New headline should possibly "add option to remove dependency to math.h" or similar? |
That sounds like a good plan to me! |
I thought I should complete what I started (and left unfinished) about 2 years ago. I see there is a build error in the verification process "CI / build-msvs (amd64_x86) (pull_request)" that is related to command line options:
I cannot see how I can fix this. |
I don't have visual studio, so can't say for sure, but I suppose |
This paragraph indicates that the |
Apologies for the delay, I've fixed the CI - try rebasing and it should work properly now. Thanks to @per-ok for the hint. |
Introducing json_pow10(), a fast power of 10 calculator, which suits JSON perfectly. (Named json_pow10 to avoid conflict with gcc builtin functions.)
This make use of the math library the default.
This adds the -DJSON_INTERNAL_MATH on the compiler command line by which the dependency to the math library is removed and internal functionality is used instead.
9507a88
to
f508768
Compare
Introducing json_pow10(), a fast power of 10 calculator, which suits JSON perfectly. (Named json_pow10 to avoid conflict with gcc builtin functions.)