> For the complete documentation index, see [llms.txt](https://docs.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.angular-package.dev/sass/math/range/range.up.md).

# range.up()

The `math.range-up()` or `range.up()` function returns the range of numbers where [`$from`](#usdfrom) is **lower** than [`$to`](#usdto).

{% code lineNumbers="true" %}

```scss
// Sass.
@use 'sass:list';

// Functions.
@use '../../meta/meta.of-type.function';

// The `math.range-up()` or `range.up` function.
@function up($from, $to, $step: 1, $except: null, $separator: auto) {
  @if meta.of-type(number, $from, $to, $step) and $from < $to {
    $result: ();
    $number: $from;
    @while $number <= $to {
      $result: if(
        not $except or ($except and not list.index($except, $number)),
        list.append($result, $number, $separator),
        $result
      );
      $number: $number + $step;
    }

    @return if(list.length($result) > 0, $result, null);
  }
  @return null;
}
```

{% endcode %}

{% embed url="<https://github.com/angular-package/sass/blob/main/math/range/_range.up.function.scss>" %}

### Parameters

#### **`$from`**

The value of the `number` type indicates the beginning of the range.

#### **`$to`**

The value of `number` type indicates the end of the range.

#### **`$step: 1`**

The value of `number` type indicates each increment of the range. By default, it's **`1`**.

#### **`$except: null`**&#x20;

The value of a `number` or `list` of numbers not belonging to the range.

#### `$separator: auto`

A separator between the given range numbers.

### Return

The return value is the list of numbers from the given range.

## Examples

```scss
// Use.
@use '@angular-package/sass/math';
@use '@angular-package/sass/math/range';

// Examples.
@debug math.range-up(15, 20); // 15 16 17 18 19 20

// step 0.1
@debug math.range-up(0.1, 1, 0.1); // 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

// step 2
@debug math.range-up(15, 30, 2); // 15 17 19 21 23 25 27 29

// except
@debug math.range-up(20, 35, 1, 20 35); // 21 22 23 24 25 26 27 28 29 30 31 32 33 34

// separator
@debug math.range-up(20, 25, $separator: comma); // 20, 21, 22, 23, 24, 25

// null
@debug math.range-up(20, 35); // null

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.angular-package.dev/sass/math/range/range.up.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
