Skip to content

test: migrate math/base/special/csc to ULP-based assertions - #13828

Merged
kgryte merged 1 commit into
developfrom
philipp/ulp-csc
Aug 1, 2026
Merged

test: migrate math/base/special/csc to ULP-based assertions#13828
kgryte merged 1 commit into
developfrom
philipp/ulp-csc

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • Migrates math/base/special/csc testing from EPS-based relative tolerance assertions to @stdlib/assert/is-almost-same-value ULP difference assertions.
  • Tightens each fixture range to the minimum required ULP tolerance, measured by running the fixture set against the implementation:
    • huge_negative / huge_positive: 2 ULP
    • very_large_negative / very_large_positive: 1 ULP
    • large, medium, small, smaller, tiny (negative/positive): exact match (0 ULP), so these now use plain t.strictEqual, matching the convention used in already-migrated sibling packages (e.g. coth, havercos) for ranges that never require tolerance.
  • Applied the identical change to test.native.js, keeping the same ULP bounds as test.js.
  • Measured minimums were confirmed deterministic by running the full fixture set twice.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

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.

AI Assistance

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

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written by Claude Code, run as a scheduled/autonomous task. It studied issue #11352 and several already-merged sibling PRs (coth, tanh, besselj0) to mirror the settled idiom, then measured the minimum passing ULP bound per fixture range directly against the implementation.


@stdlib-js/reviewers


Generated by Claude Code

Replaces the EPS-based relative tolerance assertions with
`@stdlib/assert/is-almost-same-value` ULP-difference assertions,
tightened to the minimum required ULP per fixture range:

- huge (negative/positive): 2 ULP
- very large (negative/positive): 1 ULP
- large/medium/small/smaller/tiny: exact (plain `strictEqual`)

Resolves a part of #11352.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MeLecApUxretH11SrzxudS
@stdlib-bot stdlib-bot added Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality. labels Aug 1, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Hello! 👋

We've noticed that you've been opening a number of PRs addressing good first issues. Thank you for your interest and enthusiasm!

Now that you've made a few contributions, we suggest no longer working on good first issues. Instead, we encourage you to prioritize cleaning up any PRs which have yet to be merged and then proceed to work on more involved tasks.

Not only does this ensure that other new contributors can work on things and get ramped up on all things stdlib, it also ensures that you can spend your time on more challenging problems. 🚀

For ideas for future PRs, feel free to search the codebase for TODOs and FIXMEs and be sure to check out other open issues on the issue tracker. Cheers!

@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/csc $\\color{green}175/175$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}175/175$
$\\color{green}+100.00\\%$

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

@kgryte kgryte added the Tests Pull requests specifically adding tests. label Aug 1, 2026
@kgryte
kgryte marked this pull request as ready for review August 1, 2026 11:38
@kgryte
kgryte requested a review from a team August 1, 2026 11:38
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 1, 2026
@kgryte
kgryte merged commit 2d4ff34 into develop Aug 1, 2026
86 checks passed
@kgryte
kgryte deleted the philipp/ulp-csc branch August 1, 2026 11:40
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants