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 math/base/special/lucasf #3348

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

Conversation

aayush0325
Copy link
Member

@aayush0325 aayush0325 commented Dec 6, 2024

Progresses #649

Description

What is the purpose of this pull request?

This pull request:

  • adds math/base/special/lucasf

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.

This branch can further be rebased to include constants/float32/max-safe-nth-lucas macro from #3337 instead of using just 34 as it is.

Checklist

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


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. bot: In Progress Pull request is currently awaiting automation. labels Dec 6, 2024
@stdlib-bot
Copy link
Contributor

@aayush0325, available slash commands include:

  • /stdlib check-files - Check for required files.
  • /stdlib update-copyright-years - Update copyright header years.
  • /stdlib lint-autofix - Auto-fix lint errors.
  • /stdlib merge - Merge changes from develop branch into this PR.
  • /stdlib rebase - Rebase this PR on top of develop branch.

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Dec 6, 2024
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Dec 6, 2024

Coverage Report

Package Statements Branches Functions Lines
math/base/special/lucasf $\color{green}224/224$
$\color{green}+100.00\%$
$\color{green}10/10$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}224/224$
$\color{green}+100.00\%$

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

@aayush0325
Copy link
Member Author

/stdlib update-copyright-years

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Dec 6, 2024
@stdlib-bot
Copy link
Contributor

@aayush0325, slash command not recognized. Please use /stdlib help to view available commands.

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Dec 6, 2024
@aayush0325
Copy link
Member Author

/stdlib update-copyright-years

@stdlib-bot stdlib-bot added bot: In Progress Pull request is currently awaiting automation. and removed bot: In Progress Pull request is currently awaiting automation. labels Dec 6, 2024
@gunjjoshi
Copy link
Member

@aayush0325 Thanks for working on this. Can you please update both JS and C benchmarks to pre-compute the values, outside the loop?

@aayush0325
Copy link
Member Author

got it, pushing soon.

@aayush0325
Copy link
Member Author

pushed

@aayush0325
Copy link
Member Author

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Dec 13, 2024
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Dec 13, 2024
@aayush0325
Copy link
Member Author

good evening @gunjjoshi, this branch has been rebased to make use of STDLIB_CONSTANT_FLOAT32_MAX_SAFE_NTH_LUCAS macros in js and C files instead of defining them as a variable, can you please give this a look.

Copy link
Member

Choose a reason for hiding this comment

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

@aayush0325 Can you update this file to use @stdlib/random/array/uniform to generate random numbers beforehand, instead of using @stdlib/random/base/randu?


# Lucas

> Compute the nth [Lucas number][lucas-number] in single-precision floating-point format.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> Compute the nth [Lucas number][lucas-number] in single-precision floating-point format.
> Compute the nth [Lucas number][lucas-number] in single-precision floating-point format.

@aayush0325 Can you update this here and everywhere else in this PR, to use:

Compute/Computes the nth [Lucas number][lucas-number] as a single-precision floating-point number.

@aayush0325
Copy link
Member Author

aayush0325 commented Dec 17, 2024

good afternoon @gunjjoshi. I've pushed the requested changes. However a linting error was stopping me from updating the description in lib/index.js to "Compute/Computes the nth Lucas number as a single-precision floating-point number." Please let me know how to proceed here.

@gunjjoshi
Copy link
Member

gunjjoshi commented Dec 17, 2024

@aayush0325 You don't have to use Compute/Computes everywhere. What I was trying to say was,
For files such as index.js, package.json, etc. we should use:

Compute the nth Lucas number as a single-precision floating-point number.

while, for the rest files, we should use:

Computes the nth Lucas number as a single-precision floating-point number.

@aayush0325
Copy link
Member Author

Ah, my bad. pushing the needed changes soon.

@aayush0325
Copy link
Member Author

Pushed, sorry for the misunderstanding.

@aayush0325 aayush0325 requested a review from gunjjoshi December 17, 2024 10:31
@aayush0325
Copy link
Member Author

I don't get why this is failing the linting tests this seems to run fine locally on the dev container @gunjjoshi

@aayush0325
Copy link
Member Author

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Dec 18, 2024
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Dec 18, 2024
@kgryte
Copy link
Member

kgryte commented Dec 19, 2024

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Dec 19, 2024
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Dec 19, 2024
@kgryte
Copy link
Member

kgryte commented Dec 19, 2024

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Dec 19, 2024
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Dec 19, 2024
#include "stdlib/math/base/napi/unary.h"

// cppcheck-suppress shadowFunction
STDLIB_MATH_BASE_NAPI_MODULE_I_F( stdlib_base_lucasf )
Copy link
Member

@gunjjoshi gunjjoshi Dec 20, 2024

Choose a reason for hiding this comment

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

Although we have used STDLIB_MATH_BASE_NAPI_MODULE_I_D in math/base/special/lucas, we can use STDLIB_MATH_BASE_NAPI_MODULE_I_I here and modify the function signature accordingly, as we have the API ready which accepts and returns an int32 value, but we don't have an API to accept int32 and return an int64 value, as in the case of lucas.

Copy link
Member

@gunjjoshi gunjjoshi Dec 20, 2024

Choose a reason for hiding this comment

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

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 Review A pull request which needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants