Skip to content

Conversation

@shiavm006
Copy link
Contributor

Description

What is the purpose of this pull request?

This pull request:

  • fixes a bug in tools/awk/variance.awk and tools/awk/stdev.awk where an undefined variable mu was used instead of the correctly initialized variable mean

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • None

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.

Both scripts implement Welford's method for computing variance/standard deviation. The variable mean is properly initialized and updated during iteration, but line 44 incorrectly referenced mu, which is never defined. AWK treats undefined variables as 0, causing incorrect calculations.

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

@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jan 17, 2026
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.

2 participants