toF32()
함수, 내장 함수 분류
Convert to f32. On an f64 argument this is the explicit, precision-losing narrow, computed as the sum of the hi and lo halves; f64 never narrows implicitly.
import { toF32 } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
const toF32: (x: ReadonlyNode<string> | number) => Node<"f32">매개변수
xReadonlyNode<string> | number
반환값
Node<'f32'>
설명
Emits f32(x) on WGSL and
float(x) on GLSL.
대상별 지원
| 대상 | 지원 | 비고 |
|---|---|---|
| WGSL (WebGPU) | 지원 |
|
| GLSL ES 3.00 (WebGL2) | 지원 |
|
| CPU 오라클 | 지원 | Evaluated in f64 by the oracle. |
관련 가이드
소스
src/core/ir/node.ts, 2376행, 커밋 c66579bf 기준