Skip to content

refactor: update math/base/special/cflipsignf to follow latest project conventions #4754

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

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

vivekmaurya001
Copy link
Contributor

@vivekmaurya001 vivekmaurya001 commented Jan 14, 2025

Description

  • refactors C implementation for @stdlib/math/base/special/cflipsignf along with relevant tests, benchmarks and examples to follow latest conventions
  • added test.native.js, benchmark.native.js, addon file , native.js
  • updated the readme file , package.json , benchmark.c , examples.c
  • updated the initial test file to use absf instead of abs

Checklist

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


@stdlib-js/reviewers

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: na
  - task: run_c_examples
    status: failed
---
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: na
  - task: run_c_examples
    status: passed
  - task: run_cpp_examples
    status: na
  - task: run_javascript_readme_examples
    status: passed
  - task: run_c_benchmarks
    status: passed
  - task: run_cpp_benchmarks
    status: na
  - task: run_fortran_benchmarks
    status: na
  - task: run_javascript_benchmarks
    status: passed
  - task: run_julia_benchmarks
    status: na
  - task: run_python_benchmarks
    status: na
  - task: run_r_benchmarks
    status: na
  - task: run_javascript_tests
    status: passed
---
@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. labels Jan 14, 2025
@vivekmaurya001 vivekmaurya001 changed the title feat: add C implementation for math/base/special/cflipsignf refactor: C implementation for math/base/special/cflipsignf Jan 14, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Jan 14, 2025

Coverage Report

Package Statements Branches Functions Lines
math/base/special/cflipsignf $\color{green}173/173$
$\color{green}+100.00\%$
$\color{green}7/7$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}173/173$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

@vivekmaurya001 vivekmaurya001 marked this pull request as draft January 14, 2025 18:20
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Jan 14, 2025
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: na
  - task: run_c_examples
    status: na
  - task: run_cpp_examples
    status: na
  - task: run_javascript_readme_examples
    status: na
  - task: run_c_benchmarks
    status: na
  - task: run_cpp_benchmarks
    status: na
  - task: run_fortran_benchmarks
    status: na
  - task: run_javascript_benchmarks
    status: na
  - task: run_julia_benchmarks
    status: na
  - task: run_python_benchmarks
    status: na
  - task: run_r_benchmarks
    status: na
  - task: run_javascript_tests
    status: passed
---
@vivekmaurya001
Copy link
Contributor Author

/stdlib update-copyright-years

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Jan 14, 2025
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Jan 14, 2025
@vivekmaurya001 vivekmaurya001 changed the title refactor: C implementation for math/base/special/cflipsignf refactor:update C implementation for math/base/special/cflipsignf Jan 14, 2025
@vivekmaurya001 vivekmaurya001 changed the title refactor:update C implementation for math/base/special/cflipsignf refactor:update c implementation for math/base/special/cflipsignf Jan 14, 2025
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: na
  - task: run_c_examples
    status: na
  - task: run_cpp_examples
    status: na
  - task: run_javascript_readme_examples
    status: na
  - task: run_c_benchmarks
    status: na
  - task: run_cpp_benchmarks
    status: na
  - task: run_fortran_benchmarks
    status: na
  - task: run_javascript_benchmarks
    status: na
  - task: run_julia_benchmarks
    status: na
  - task: run_python_benchmarks
    status: na
  - task: run_r_benchmarks
    status: na
  - task: run_javascript_tests
    status: na
---
@vivekmaurya001 vivekmaurya001 changed the title refactor:update c implementation for math/base/special/cflipsignf refactor: update c implementation for math/base/special/cflipsignf Jan 14, 2025
…tdlib into math/cflipsignf

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: na
  - task: run_c_examples
    status: na
  - task: run_cpp_examples
    status: na
  - task: run_javascript_readme_examples
    status: na
  - task: run_c_benchmarks
    status: na
  - task: run_cpp_benchmarks
    status: na
  - task: run_fortran_benchmarks
    status: na
  - task: run_javascript_benchmarks
    status: na
  - task: run_julia_benchmarks
    status: na
  - task: run_python_benchmarks
    status: na
  - task: run_r_benchmarks
    status: na
  - task: run_javascript_tests
    status: na
---
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: na
  - task: run_c_examples
    status: na
  - task: run_cpp_examples
    status: na
  - task: run_javascript_readme_examples
    status: na
  - task: run_c_benchmarks
    status: na
  - task: run_cpp_benchmarks
    status: na
  - task: run_fortran_benchmarks
    status: na
  - task: run_javascript_benchmarks
    status: na
  - task: run_julia_benchmarks
    status: na
  - task: run_python_benchmarks
    status: na
  - task: run_r_benchmarks
    status: na
  - task: run_javascript_tests
    status: na
---
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: na
  - task: run_c_examples
    status: na
  - task: run_cpp_examples
    status: na
  - task: run_javascript_readme_examples
    status: na
  - task: run_c_benchmarks
    status: na
  - task: run_cpp_benchmarks
    status: na
  - task: run_fortran_benchmarks
    status: na
  - task: run_javascript_benchmarks
    status: na
  - task: run_julia_benchmarks
    status: na
  - task: run_python_benchmarks
    status: na
  - task: run_r_benchmarks
    status: na
  - task: run_javascript_tests
    status: na
---
@vivekmaurya001 vivekmaurya001 marked this pull request as ready for review January 14, 2025 19:00
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jan 14, 2025
@vivekmaurya001
Copy link
Contributor Author

vivekmaurya001 commented Jan 14, 2025

good morning @kgryte @Planeshifter , @gunjjoshi , it is ready for review

@gunjjoshi gunjjoshi self-requested a review January 16, 2025 01:06
@gunjjoshi
Copy link
Member

@vivekmaurya001 Looks like there is a conflict in example.c. Can you resolve it?

@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Mar 2, 2025
@vivekmaurya001 vivekmaurya001 reopened this Mar 2, 2025
@vivekmaurya001
Copy link
Contributor Author

vivekmaurya001 commented Mar 2, 2025

@gunjjoshi , resolved the conflicts

@anandkaranubc anandkaranubc self-requested a review April 15, 2025 08:46
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 15, 2025
@anandkaranubc
Copy link
Contributor

anandkaranubc commented Apr 15, 2025

@vivekmaurya001 Could you please resolve the conflict in benchmark.c and review the changes in #4767 to see if they are applicable here as well?

Thanks!

@vivekmaurya001
Copy link
Contributor Author

@anandkaranubc , I have resolved the conflicts , thanks for reviewing !

@anandkaranubc anandkaranubc changed the title refactor: update c implementation for math/base/special/cflipsignf refactor: update math/base/special/cflipsignf to follow latest project conventions Apr 16, 2025
* stdlib_complex64_t out = stdlib_base_cflipsignf( z, -1.0 );
*
* float re = stdlib_complex64_real( out );
* // returns -3.5
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* // returns -3.5
* // returns -3.5f

* // returns -3.5
*
* float im = stdlib_complex64_imag( out );
* // returns 2.5
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* // returns 2.5
* // returns 2.5f

float re = crealf( z );
float im = cimagf( z );
stdlib_complex64_t stdlib_base_cflipsignf( const stdlib_complex64_t z, const float y ) {
float re ;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
float re ;
float re;

float im = cimagf( z );
stdlib_complex64_t stdlib_base_cflipsignf( const stdlib_complex64_t z, const float y ) {
float re ;
float im ;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
float im ;
float im;

@anandkaranubc
Copy link
Contributor

@vivekmaurya001 Following up on my previous comment, could you ensure that the changes made in #4767 are also reflected here? I still see the same pending changes here.

@anandkaranubc anandkaranubc added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Apr 17, 2025
vivekmaurya001 and others added 2 commits April 18, 2025 01:38
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: missing_dependencies
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: missing_dependencies
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@vivekmaurya001 vivekmaurya001 marked this pull request as draft April 17, 2025 20:21
@vivekmaurya001 vivekmaurya001 marked this pull request as ready for review April 18, 2025 07:58
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 18, 2025
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. Needs Changes Pull request which needs changes before being merged. Needs Review A pull request which needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants