Skip to content

Conversation

@opbot-xd
Copy link
Contributor


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: passed
  • task: lint_package_json status: passed
  • task: lint_repl_help status: passed
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: passed
  • task: lint_javascript_tests status: passed
  • task: lint_javascript_benchmarks status: na
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: na
  • task: lint_c_examples status: na
  • task: lint_c_benchmarks status: na
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: na
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: passed
  • task: lint_license_headers status: passed

Description

What is the purpose of this pull request?

This pull request:

  • Adds the @stdlib/constants/float16/log2-e package, which provides the half-precision (float16) approximation of the base 2 logarithm of Euler's number (log₂(e) ≈ 1.4424).
  • Includes complete implementation with documentation, unit tests, examples, TypeScript declarations, and REPL help text.
  • Follows all stdlib package conventions and style guidelines.

Related Issues

Does this pull request have any related issues?

This pull request addresses the need for additional float16 mathematical constants in stdlib, complementing the existing float64 log2-e constant.

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.

Implementation Notes:

  • The float16 value 1.4424 was calculated as the half-precision representation of log₂(e) ≈ 1.4426950408889634
  • All tests pass with 100% coverage
  • Package structure mirrors existing float16 constants (e.g., @stdlib/constants/float16/e)

Test Results:

TAP version 13

main export is a number
ok 1 main export is a number

export is a half-precision floating-point number equal to 1.4424
ok 2 returns expected value

tests 3
pass 3
ok

Checklist

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

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

@stdlib-js/reviewers

---
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: passed
  - task: lint_package_json
    status: passed
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: passed
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Dec 13, 2025
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
constants/float16/log2-e $\color{green}47/47$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}0/0$
$\color{green}+100.00%$
$\color{green}47/47$
$\color{green}+100.00%$

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

@DivyanshuVortex
Copy link
Contributor

Hey @opbot-xd , this PR is aldready open by me #8991 .

@opbot-xd
Copy link
Contributor Author

Hey @DivyanshuVortex can you provide me the issue, I need to see what constants are left.

@DivyanshuVortex
Copy link
Contributor

DivyanshuVortex commented Dec 14, 2025

@opbot-xd — I’m also loking for missing packages, but there are currrently many open PRs adding similar ones. Because of that, I can’t say for sure whether the package you added is already covered in earlier PRs. Im waiting for maintainers to review & merge or close those PRs which make more clearer for finding the missing packages .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants