---
title: "relative(to:)"
framework: coreai
role: symbol
role_heading: Instance Method
path: "coreai/ndarray/rangeexpression/relative(to:)"
---

# relative(to:)

Returns Range for the dimension.

## Declaration

```swift
func relative(to dimension: Range<Int>) -> Range<Int>
```

## Parameters

- `dimension`: The dimension of the axis on which the range expression is used.

## Return Value

Return Value The range of the selected dimension.

## Discussion

Discussion For example, when the range expression specifies 1... on the axis with dimension 3, the resultant Range is 1 ..< 3.
