Skip to content

Restrict linspace support to floating-point data types #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 28, 2022

Conversation

kgryte
Copy link
Contributor

@kgryte kgryte commented Feb 21, 2022

This PR

  • resolves linspace behavior is underspecified for integer dtypes #392 in accordance with discussions during the 2022-02-17 consortium meeting. Namely, linspace should be limited to floating-point output data types, unless a conforming implementation has compelling reasons for supporting integer output data types (e.g., due to backward compatibility). However, integer output behavior is left implementation-defined and should not, in general, be considered portable.
  • adds a note concerning the conversion of int start and stop values to floating-point. Namely, that overflow behavior is implementation-defined. This follows similar guidance elsewhere in the specification.

@kgryte kgryte added API change Changes to existing functions or objects in the API. topic: Creation Array creation. labels Feb 21, 2022
@kgryte kgryte added this to the v2021 milestone Feb 21, 2022
@kgryte
Copy link
Contributor Author

kgryte commented Feb 21, 2022

cc @honno

Copy link
Member

@honno honno left a comment

Choose a reason for hiding this comment

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

LGTM. Good shout on noting non-representable start and stop args.

@kgryte
Copy link
Contributor Author

kgryte commented Feb 28, 2022

As the changes in this PR are straightforward and have been discussed in consortium meetings, will go ahead and merge so that changes, if any, can be updated in the test suite.

@kgryte kgryte merged commit 157c16b into main Feb 28, 2022
@kgryte kgryte deleted the linspace-int-dtypes branch February 28, 2022 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change Changes to existing functions or objects in the API. topic: Creation Array creation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

linspace behavior is underspecified for integer dtypes
2 participants