Skip to content

math: add normalized sinc ufunc - #882

Merged
ulises-jeremias merged 2 commits into
vlang:mainfrom
ulises-jeremias:copilot/vtl-numpy-sinc-20261117
Nov 20, 2026
Merged

ulises-jeremias merged 2 commits into
vlang:mainfrom
ulises-jeremias:copilot/vtl-numpy-sinc-20261117

Conversation

@ulises-jeremias

@ulises-jeremias ulises-jeremias commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add Tensor.sinc() using NumPy's normalized-sinc definition, with 1 at either signed zero and NaN results for NaN/infinite inputs.
  • Preserve shape and f32/f64 dtype; reject integer inputs and document this deliberate difference from NumPy's integer promotion.
  • Add edge-case tests, parity/tutorial documentation, and a runnable example.

This is a focused ufunc slice related to #777; it does not close the broader parity issue.

Validation

  • Focused math_sinc_test.v passed in debug and production modes (1/1 each).
  • v fmt -verify passed for changed V files.
  • v check-md checked the four changed Markdown files and 14 tutorial examples: zero errors, with eight warnings on pre-existing long table rows outside the changed hunks.
  • The example ran successfully and produced the expected values for 0, ±0.5, and 1.
  • git diff --check passed. Hosted CI is pending on this draft PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…resh-20261118

* origin/main:
  math: add scalar logaddexp variants (vlang#884)
  math: add promoted scalar extrema (vlang#879)
  feat(nn): add CPU Sequential inference checkpoints (vlang#876)
  ci: gate paired VTL/VSL release candidates
  math: add scalar ldexp ufunc variants (vlang#880)
  math: add promoted extrema ufuncs (vlang#777) (vlang#878)
  fix(autograd): detach operations inside no_grad (vlang#873)
  fix(math): preserve exact integer absolute values (vlang#875)
@ulises-jeremias
ulises-jeremias marked this pull request as ready for review November 20, 2026 05:42
@ulises-jeremias
ulises-jeremias merged commit 8e8a409 into vlang:main Nov 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant