Use the standard library fabs()
See original GitHub issueI noticed there is a custom implementation of fabs()
in rationalTime.h
, it might be nice to replace it with the function from the standard library:
https://en.cppreference.com/w/cpp/numeric/math/fabs
It would reduce the amount of code in OpenTime and remove a function that should probably not be part of the API.
Issue Analytics
- State:
- Created 9 months ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
C fabs() - C Standard Library - Programiz
The fabs() function takes a single argument (in double ) and returns the absolute value of that number (also in double ). [Mathematics]...
Read more >C library function - fabs() - Tutorialspoint
Description. The C library function double fabs(double x) returns the absolute value of x. Declaration. Following is the declaration for fabs() function.
Read more >std::abs(float), std::fabs, std::fabsf, std::fabsl - cppreference.com
1-8) Computes the absolute value of a floating point value arg . 9) A set of overloads or a function template accepting an...
Read more >fabs - CPlusPlus.com
fabs example */ #include <stdio.h> /* printf */ #include <math.h> /* fabs */ int main () { printf ( "The absolute value of...
Read more >C Math Library Function fabs() - Explanation And Example
fabs() is the standard C math library function that is defined in math library math.h and it returns the absolute value of number...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s only in the public API because of the constexpr business. It could be made private copied twice within RationalTime and TimeRange. I’d have no argument with that, as I do concur with your implication that it is an implementation detail.
It’s only in the public API Because of the constexpr business It could be made private Copied twice within RationalTime and TimeRange
I’d have no argument with that As I do concur with your implication That it is an implementation detail Best left hidden from the user’s view
But still it remains in the API A small cog in the machine Doing its job without complaint A faithful servant to the code it serves
Though its purpose may not be clear To those who use the API without fear It plays its role without protest A silent partner in the quest
For efficient, reliable software That does its job without a fuss So let us give thanks to the constexpr business And the small part it plays in our code’s success.
I think GPT3 could in fact write documentation for us, or to put it a different way, it could write a rather prosey explanation that might provide a good starting point for clearly explaining what some code does. You can grab a function and ask it “Explain the following code: <paste code>”. Josh has been experimenting with it.