docs: simplify abs example by removing dtype#9563
Closed
Atharv-K-979 wants to merge 1 commit intostdlib-js:developfrom
Closed
docs: simplify abs example by removing dtype#9563Atharv-K-979 wants to merge 1 commit intostdlib-js:developfrom
Atharv-K-979 wants to merge 1 commit intostdlib-js:developfrom
Conversation
kgryte
reviewed
Jan 5, 2026
| var logEachMap = require( '@stdlib/console/log-each-map' ); | ||
| var abs = require( './../lib' ); | ||
|
|
||
| var x = discreteUniform( 100, -100, 100, { |
Member
There was a problem hiding this comment.
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.
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request simplifies the
absexample by removing an explicitfloat64dtype from thediscreteUniformcall.While reviewing the code and following the stdlib documentation, I observed that
discreteUniformgenerates 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
@stdlib-js/reviewers