A robot-analysis notebook requests seven candidate coordinates between minus four and four. Asking NumPy linspace for an integer dtype can produce different negative points from generating a floating-point grid and converting it afterward. Both outputs contain seven integers and the same endpoints, so a superficial check can miss the changed candidates.
The distinction comes from the rounding rule used when the points become integers. An original local fixture compares the two calls, their adjacent gaps, and a denser request that returns repeated integers. These are invented unitless coordinates for explaining a software interface, not robot commands or measured positioning behavior.
Preserve the floating-point reference grid
Begin with np.linspace(-4.,4.,7), leaving the output dtype unspecified and retaining the default endpoint=True. The local NumPy 2.5.2 call returns a float64 array. To displayed precision, its entries are [-4,-2.666667,-1.333333,0,1.333333,2.666667,4].
There are six intervals across the span of eight, giving a nominal floating-point step of four thirds. The fixture records that step and checks the neighboring differences against it within 1e-14. The displayed decimals are rounded summaries; the saved numerical proof retains the actual returned floating-point values.
This reference identifies what the request means before integer quantization. Seven requested samples do not imply a one-unit integer step, and the endpoints alone do not identify the interior values. Keep the original floating-point sequence available when a later representation changes those values.
Compare direct integer generation with a later cast
The call np.linspace(-4.,4.,7,dtype=np.int64) returns [-4,-3,-2,0,1,2,4] in the executed fixture. The current linspace reference documents rounding toward negative infinity for integer output. For this particular floating grid, applying floor and then converting to int64 reproduces the direct integer result.
The separate path np.linspace(-4.,4.,7).astype(np.int64) instead returns [-4,-2,-1,0,1,2,4]. In these finite in-range values, the later conversion removes the fractional part toward zero. The two negative interior points differ by one between the paths; the nonnegative points agree here.
Use the entry around minus 2.666667 to see the distinction. Directed rounding toward negative infinity selects minus three. Conversion toward zero selects minus two in this case. Both policies reduce a fractional value to an integer, but they do not define the same candidate set.
Neither call is a universal recommendation. A notebook must decide which quantization policy its analysis requires and state that choice. Merely selecting an integer output type does not establish nearest-integer selection, symmetry around zero, or compatibility with an external device's permitted values.
Check the gaps after quantization
The direct integer sequence has successive gaps [1,1,2,1,1,2]. The floating-grid-then-cast sequence has gaps [2,1,1,1,1,2]. Every gap is computed from the actual integer result, not copied from the nominal floating-point step.
Thus an evenly spaced underlying real-valued request need not remain evenly spaced after integer representation. The first direct sequence is also not symmetric under reversing the order and negating each entry, whereas the later-cast sequence is symmetric for this chosen example. That observation is specific to these endpoints and points, not a claim that later casting always produces a suitable grid.
If downstream code assumes equal integer spacing, test that requirement explicitly. Matching element count and minimum and maximum would accept both seven-point outputs above while ignoring their different interior locations and adjacent gaps. A result receipt should retain the generated coordinates themselves.
More requested samples can repeat the same integer
A separate original request, np.linspace(0.,4.,9,dtype=np.int64), returns [0,0,1,1,2,2,3,3,4]. The array has nine entries but only five unique values. Its underlying floating-point spacing is one half before integer representation, so several requested samples map to the same integer coordinate.
For a list interpreted as distinct candidate coordinates, that difference affects coverage. Evaluating every array entry would revisit some coordinates in this fixture. It would not evaluate nine distinct locations. An application might deliberately retain repeated entries with separate meanings, but that would be another stated contract.
Do not silently drop duplicates as a generic repair. Removing them changes the returned count and can alter the relationship between entries and other arrays. If uniqueness is required, compare the returned and unique counts, preserve the original sequence, and decide how the producer should satisfy the requirement.
Rejecting information loss is another explicit choice
The astype reference includes a same_value casting mode that rejects conversions when values would change. On the local NumPy 2.5.2 installation, converting the saved seven-point floating grid to int64 with casting='same_value' raises ValueError because fractional entries cannot be preserved as those integers.
That exception is an intentional boundary test. It neither selects floor rounding nor recovers a preferred set of integer coordinates. It can support an interface that forbids silent value changes, while an interface permitting quantization must still name its allowed rule.
The fixture uses an explicit int64 destination and small finite values within its range. It does not generalize the observed conversion to NaNs, infinities, out-of-range magnitudes, other numeric types, or every historical NumPy version. Record the actual library version and conversion arguments beside the result.
Keep candidate generation separate from motion permission
A proposed notebook receipt stores start, stop, num, endpoint choice, floating reference, requested dtype, quantization path, returned coordinates, unique count, and adjacent gaps. Tests include negative fractional points and a request dense enough to create duplicates, because positive integral points alone would conceal both distinctions.
These software coordinates establish no mechanical resolution, reachable pose, collision-free trajectory, or permission to move a robot. The practical conclusion concerns the generator: an integer dtype in linspace and a later integer cast can produce different negative candidates, and num describes returned entries rather than a guarantee of distinct integer locations.
Sources checked November 18, 2026:
NumPy, numpy.linspace, version 2.5 manual:
https://numpy.org/doc/stable/reference/generated/numpy.linspace.html
NumPy, numpy.ndarray.astype, version 2.5 manual:
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.astype.html
Python 3.14.7 and NumPy 2.5.2 produced the isolated calculations. All coordinate sequences, gap comparisons, and proposed receipt checks are original T-800 editorial work, not source examples or a physical robot experiment.
Illustration: an AI-generated concept compares the two seven-entry integer sequences from the same floating-point request. It does not depict actual robot travel or positioning accuracy.