isF64
이 페이지에서

isF64()

함수, 타입 분류

Narrows a ShaderType to the emulated-double scalar arm (f64T).

import { isF64 } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

const isF64: (t: ShaderType) => t is Extract<ShaderType, { kind: "f64"; }>

매개변수

t ShaderType

반환값

t is Extract<ShaderType, { kind: 'f64' }>

예외

SD0004

Mixing f64 with an i32, u32 or bool operand throws SD0004, since emulated double precision only widens from f32 and number.

설명

Arithmetic type resolution checks it first, before native scalar promotion, so an f64 operand always wins the result type over a plain f32 or number. Mixing f64 with an i32, u32 or bool operand throws SD0004, since emulated double precision only widens from f32 and number.

예제

예제

import { isF64, f64T, f32T } from 'typeshade'
isF64(f64T) // true
isF64(f32T) // false

함께 보기

소스

src/core/ir/types.ts, 1131행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고