Add complex number support to linspace
#568
Merged
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.
This PR
linspace
.start
andstop
to becomplex
numbers.dtype
to a complex floating-point data type, not just a real-valued floating-point data type.dtype
isNone
, if eitherstart
orstop
is a complex number, then the output dtype must be the default complex floating-point dtype; otherwise, the output dtype must be the default real-valued floating-point dtype.start
andstop
should follow type promotion rules; conversions not following type promotion rules are implementation-dependent (e.g., NumPy allows specifying a real-valued dtype whenstart
and/orstop
is complex by discarding the imaginary component; as such a conversion is not specified in this standard, such behavior is implementation-defined).linspace
raise an exception ifnum
is a not a nonnegative integer, as the standard typically avoids specifying validation behavior, leaving it up to conforming libraries to determine how to best handle invalid inputs (e.g., raise an exception, clip inputs, etc).