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/minmax #1939

Closed
wants to merge 28 commits into from

Conversation

Rejoan-Sardar
Copy link
Contributor

@Rejoan-Sardar Rejoan-Sardar commented Mar 18, 2024

Resolves #2106 .

Description

What is the purpose of this pull request?

This pull request:

  • add C implementation for math/base/special/minmax

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.

No.

Checklist

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

  • Read, understood, and followed the [contributing guidelines][contributing].

@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Mar 18, 2024
@Planeshifter Planeshifter added Needs Review A pull request which needs code review. Native Addons Issue involves or relates to Node.js native add-ons. C Issue involves or relates to C. labels Mar 18, 2024
@kgryte kgryte changed the title feat: add C implementation for math/base/special/minmax feat: add C implementation for math/base/special/minmax Mar 18, 2024
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! Left some comments that will need to be addressed.

@Planeshifter Planeshifter added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Mar 24, 2024
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Signed-off-by: Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Comment on lines +39 to +61
if ( stdlib_base_is_nan( x ) || stdlib_base_is_nan( y ) ) {
*min = 0.0 / 0.0; // NaN
*max = 0.0 / 0.0; // NaN
return;
}
if( x == y && x == 0.0 ) {
if ( stdlib_base_is_negative_zero ( x ) ) {
*min = x;
*max = y;
return;
}
*min = y;
*max = x;
return;
}
if ( x < y ) {
*min = x;
*max = y;
return;
}
*min = y;
*max = x;
return;
Copy link
Member

Choose a reason for hiding this comment

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

You have mixed tab and space indentation. It should be TAB indentation.

@Rejoan-Sardar Rejoan-Sardar closed this by deleting the head repository Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Issue involves or relates to C. Math Issue or pull request specific to math functionality. Native Addons Issue involves or relates to Node.js native add-ons. Needs Changes Pull request which needs changes before being merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: Add C implementation for @stdlib/math/base/special/minmax
4 participants