---
title: "step(): typeshade/core/ir의 IR 빌더 함수, TypeShade 컴파일러 API"
description: "step, typeshade/core/ir의 IR 빌더 함수입니다. step(edge, x): x가 edge보다 작은 곳은 0, 그 밖의 곳은 1이며 성분별로 계산합니다."
url: https://typeshade.dev/ko/api/step/
language: ko
---

# `step()`

함수, 내장 함수 분류

`step(edge, x)`: x가 edge보다 작은 곳은 0, 그 밖의 곳은 1이며 성분별로 계산합니다.

`import { step } from 'typeshade/core/ir'`

이 export는 IR 노드를 반환합니다. `"use typeshade"` 파일에서는 내장 함수 자체를 부릅니다: [`step()`](https://typeshade.dev/ko/reference/functions/step/)

설명은 커밋 af54ddad5의 검토된 컴파일러 문서를 번역한 것입니다. 시그니처와 예제 코드는 원문을 따르며, 필요한 경우 설명에 편집상 수정이 반영됩니다.

## 구문

```ts
const step: <K extends FloatKey>(
  edge: NoInfer<ArithArg<K>>,
  x: ReadonlyNode<K>,
) => Node<K>
```

## 매개변수

**`edge` `NoInfer<ArithArg<K>>`**

**`x` `ReadonlyNode<K>`**

## 반환값

`Node<K>`

## 설명

결과의 키는 `x`로 정해집니다. WGSL은 `edge`와 `x`가 같은 타입이어야 한다고 요구합니다.

## 대상별 지원

| 대상 | 지원 | 비고 |
| --- | --- | --- |
| WGSL (WebGPU) | 지원 | `step(edge, x)`. |
| GLSL ES 3.00 (WebGL2) | 지원 | `step(edge, x)`. |
| CPU 오라클 | 지원 | 오라클이 `f64`로 계산합니다. |

## 관련 가이드

- [CPU 오라클 안내서](https://typeshade.dev/ko/guide/internals/the-cpu-oracle/)

## 함께 보기

- [`step()`](https://typeshade.dev/ko/reference/functions/step/)

## 소스

[`src/core/ir/node.ts`, 1543행](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L1543), 커밋 af54ddad5 기준
