-
-
Notifications
You must be signed in to change notification settings - Fork 596
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
feat: add math/base/special/atan2f
#3338
base: develop
Are you sure you want to change the base?
Conversation
math/base/special/atan2f
math/base/special/atan2f
i see that this PR is failing a lot of tests. you should update your |
"dependencies": [
"@stdlib/math/base/napi/binary",
"@stdlib/math/base/assert/is-infinitef",
"@stdlib/math/base/special/copysignf",
"@stdlib/number/float32/base/signbit",
"@stdlib/math/base/assert/is-nanf",
"@stdlib/math/base/special/atanf",
"@stdlib/constants/float32/pinf",
"@stdlib/constants/float32/pi"
] this is how you should fill the dependencies in |
@aayush0325 thanks for the assist. |
use |
@Neerajpathak07 The issue here is that |
3a84f9e
to
19271d9
Compare
@Planeshifter The PR related to |
* | ||
* ## Notice | ||
* | ||
* The original code, copyright and license are from [Go]{@link https://golang.org/src/math/atan2.go}. The implementation follows the original, but has been modified for JavaScript. |
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.
@kgryte
Apparently there was no golang source link for atan2f
which is why I have kept it atan2
for now.
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.
basically you need to generate the fixtures using the julia script and not copy them over from the double precision implementation
Computes the angle in the plane (in radians) between the positive x-axis and the ray from `(0,0)` to the point `(x,y)` for single-precision floating-point number. | ||
|
||
```c | ||
float out = stdlib_base_atan2f( 2.0,f 2.0f ); |
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.
float out = stdlib_base_atan2f( 2.0,f 2.0f ); | |
float out = stdlib_base_atan2f( 2.0f, 2.0f ); |
#include "stdlib/constants/float32/pinf.h" | ||
#include "stdlib/constants/float32/ninf.h" | ||
#include "stdlib/constants/float32/pi.h" | ||
#include <stdint.h> |
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.
#include <stdint.h> |
i don't think this header is being used
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.
ahh, these fixtures are probably the cause of failing tests here, you've copied these over from the double precision implementation as I compared the both and there is no diff. You are bound to face errors if you test your single precision implementation against a double precision dataset. CD into the dir and generate these fixtures by running runner.jl
you may need to setup Julia and install JSON package for that first
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.
holding out on further review before this is resolved, this should be it i think
The reason for the failing benchmarks is probably because you copied over the Makefile wrongly, use the one in |
Makefile that you should be using. This adds the include dirs so that you don't run into the error that we're currently facing here |
@@ -1,4 +1,4 @@ | |||
#/ | |||
|
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 change is not correct. The comment should begin with #/
.
Resolves #649
Description
This pull request:
math/base/special/atan2f
, which would be a single precision implementation for math/base/special/atan2.Related Issues
This pull request:
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers