isF64()
Function in Types
Narrows a ShaderType to the emulated-double scalar arm (f64T).
import { isF64 } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
const isF64: (t: ShaderType) => t is Extract<ShaderType, { kind: "f64"; }>Parameters
Return value
t is Extract<ShaderType, { kind: 'f64' }>
Exceptions
SD0004Mixing f64 with an i32, u32 or bool operand throws SD0004, since emulated double precision only widens from f32 and number.
Description
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.
Examples
Example
import { isF64, f64T, f32T } from 'typeshade'
isF64(f64T) // trueisF64(f32T) // falseSee also
Source
src/core/ir/types.ts, line 1131, at commit 26de7be8