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

feat: add C implementation for math/base/special/cos #2352

Merged
merged 2 commits into from
Jun 10, 2024
Merged

feat: add C implementation for math/base/special/cos #2352

merged 2 commits into from
Jun 10, 2024

Conversation

gunjjoshi
Copy link
Member

@gunjjoshi gunjjoshi commented Jun 10, 2024

Description

What is the purpose of this pull request?

This pull request:

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

I have added the extended comment from the FreeBSD source in both the C and javascript implementations.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Jun 10, 2024
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
@Planeshifter
Copy link
Member

@gunjjoshi Thank you, @gunjjoshi! Will merge shortly.

@Planeshifter Planeshifter merged commit 343da6f into stdlib-js:develop Jun 10, 2024
8 checks passed
#ifndef STDLIB_MATH_BASE_SPECIAL_COS_H
#define STDLIB_MATH_BASE_SPECIAL_COS_H

#include <stdint.h>
Copy link
Member

Choose a reason for hiding this comment

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

This include is not necessary.

#include <stdint.h>

// High word absolute value mask: 0x7fffffff => 01111111111111111111111111111111
static const int32_t HIGH_WORD_ABS_MASK = 0x7fffffff;
Copy link
Member

Choose a reason for hiding this comment

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

I believe we have a constant package for this.

static const int32_t HIGH_WORD_TWO_NEG_27 = 0x3e400000;

// High word exponent mask: 0x7ff00000 => 01111111111100000000000000000000
static const int32_t HIGH_WORD_EXPONENT_MASK = 0x7ff00000;
Copy link
Member

Choose a reason for hiding this comment

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

Same comment. We have a pkg for this, IIRC.

@gunjjoshi
Copy link
Member Author

@kgryte I've made a new PR incorporating the changes at #2355.

kgryte pushed a commit that referenced this pull request Jun 10, 2024
PR-URL: #2355
Ref: #2352
Reviewed-by: Athan Reines <kgryte@gmail.com>
aman-095 pushed a commit to aman-095/stdlib that referenced this pull request Jun 11, 2024
PR-URL: stdlib-js#2352 
Ref: stdlib-js#649 

---------

Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.com>
Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
aman-095 pushed a commit to aman-095/stdlib that referenced this pull request Jun 11, 2024
PR-URL: stdlib-js#2355
Ref: stdlib-js#2352
Reviewed-by: Athan Reines <kgryte@gmail.com>
aman-095 pushed a commit to aman-095/stdlib that referenced this pull request Jun 13, 2024
PR-URL: stdlib-js#2352 
Ref: stdlib-js#649 

---------

Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.com>
Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
aman-095 pushed a commit to aman-095/stdlib that referenced this pull request Jun 13, 2024
PR-URL: stdlib-js#2355
Ref: stdlib-js#2352
Reviewed-by: Athan Reines <kgryte@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Math Issue or pull request specific to math functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants