Skip to content

Conversation

@Atharv-K-979
Copy link

@Atharv-K-979 Atharv-K-979 commented Jan 5, 2026

Description

This pull request simplifies the abs example by removing an explicit float64 dtype from the discreteUniform call.

While reviewing the code and following the stdlib documentation, I observed that discreteUniform generates integer values by default. The explicit dtype is therefore unnecessary, and removing it avoids potential ambiguity between the integer format specifier used in the example output and the underlying data type, while keeping the example behavior unchanged.

Related Issues

None.

Questions

No.

Other

No.

Checklist

AI Assistance

  • Yes
  • No

@stdlib-js/reviewers

@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. labels Jan 5, 2026
var logEachMap = require( '@stdlib/console/log-each-map' );
var abs = require( './../lib' );

var x = discreteUniform( 100, -100, 100, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conversely, the float64 dtype also signifies that abs accepts and expects double-precision floating-point numbers. As such, I am not convinced that the proposed change is warranted.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification — I understand your point.

I see that explicitly specifying float64 in the example serves as documentation of the expected input type for abs, rather than being incidental to the example output.

Given that, I agree the change is not warranted. I’m happy to close the PR.

Thanks for taking the time to explain the rationale.

@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Math Issue or pull request specific to math functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants