feat: add math/base/special/truncsdf#10606
feat: add math/base/special/truncsdf#10606aryan7071 wants to merge 5 commits intostdlib-js:developfrom
Conversation
---
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: passed
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: missing_dependencies
- task: lint_c_examples
status: missing_dependencies
- task: lint_c_benchmarks
status: missing_dependencies
- 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 update-copyright-years |
---
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: passed
- 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: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Coverage Report
The above coverage report was generated for the changes in this PR. |
Planeshifter
left a comment
There was a problem hiding this comment.
Thanks for opening PR! Need to change the implementation to not continuously cast back to double by using single-precision functions.
| "dependencies": [ | ||
| "@stdlib/math/base/napi/ternary", | ||
| "@stdlib/math/base/assert/is-nan", | ||
| "@stdlib/math/base/assert/is-infinite", | ||
| "@stdlib/math/base/special/pow", | ||
| "@stdlib/math/base/special/log10", | ||
| "@stdlib/math/base/special/ln", | ||
| "@stdlib/math/base/special/abs", | ||
| "@stdlib/math/base/special/floor", | ||
| "@stdlib/math/base/special/trunc", | ||
| "@stdlib/number/float32/base/exponent", | ||
| "@stdlib/number/float64/base/to-float32" | ||
| ] |
There was a problem hiding this comment.
The build task dependencies are wrong. The C code (src/main.c) uses single-precision functions (is_nanf, is_infinitef, powf, log10f, lnf, absf, floorf, truncf, float32/base/exponent), but the build dependencies list the double-precision equivalents. This will fail to resolve the correct headers at build time.
The build dependencies should match the benchmark/examples dependencies:
| "dependencies": [ | |
| "@stdlib/math/base/napi/ternary", | |
| "@stdlib/math/base/assert/is-nan", | |
| "@stdlib/math/base/assert/is-infinite", | |
| "@stdlib/math/base/special/pow", | |
| "@stdlib/math/base/special/log10", | |
| "@stdlib/math/base/special/ln", | |
| "@stdlib/math/base/special/abs", | |
| "@stdlib/math/base/special/floor", | |
| "@stdlib/math/base/special/trunc", | |
| "@stdlib/number/float32/base/exponent", | |
| "@stdlib/number/float64/base/to-float32" | |
| ] | |
| "dependencies": [ | |
| "@stdlib/math/base/napi/ternary", | |
| "@stdlib/math/base/assert/is-nanf", | |
| "@stdlib/math/base/assert/is-infinitef", | |
| "@stdlib/math/base/special/powf", | |
| "@stdlib/math/base/special/log10f", | |
| "@stdlib/math/base/special/lnf", | |
| "@stdlib/math/base/special/absf", | |
| "@stdlib/math/base/special/floorf", | |
| "@stdlib/math/base/special/truncf", | |
| "@stdlib/number/float32/base/exponent" | |
| ] |
| #include "stdlib/math/base/assert/is_nanf.h" | ||
| #include "stdlib/math/base/assert/is_infinitef.h" | ||
| #include "stdlib/math/base/special/powf.h" | ||
| #include "stdlib/math/base/special/log10f.h" |
There was a problem hiding this comment.
@stdlib/math/base/special/log10f does not exist in the codebase. This include will cause a compilation error.
You'll either need to create log10f as a separate package first, or use stdlib_base_lnf(x) / stdlib_base_lnf(10.0f) for the base-10 case.
| #include "stdlib/math/base/special/truncsdf.h" | ||
| #include "stdlib/math/base/assert/is_nan.h" | ||
| #include "stdlib/math/base/assert/is_infinite.h" | ||
| #include "stdlib/math/base/special/pow.h" | ||
| #include "stdlib/math/base/special/log10.h" | ||
| #include "stdlib/math/base/special/ln.h" | ||
| #include "stdlib/math/base/special/abs.h" | ||
| #include "stdlib/math/base/special/floor.h" | ||
| #include "stdlib/math/base/special/trunc.h" | ||
| #include "stdlib/number/float32/base/exponent.h" | ||
| #include <stdint.h> |
There was a problem hiding this comment.
We should use the single-precision variants of these, i.e. #include "stdlib/math/base/special/absf.h etc.
---
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: na
- task: lint_repl_help
status: na
- 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: passed
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: missing_dependencies
- task: lint_c_examples
status: missing_dependencies
- task: lint_c_benchmarks
status: missing_dependencies
- 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 update-copyright-years |
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Description
This pull request:
Related Issues
This pull request has the following related issues:
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers