f64
이 페이지에서

f64()

함수, 값 분류

An f64 literal node.

import { f64 } from 'typeshade'

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

구문

function f64(v: number): Node<'f64'>;
function f64(x: ReadonlyNode<'f32'>): Node<'f64'>;

매개변수

v number

반환값

Node<'f64'>

예외

TypeError

v is neither a JS number nor an f32 node.

SD0116

SD0116 when the node operand is not a scalar.

설명

The literal carries the full JS double value and is split into its (hi, lo) f32 halves when the module is built, so the authored constant round-trips without loss.

An f32 Node argument is a cast instead — the exact widening toF64 performs, and the free-function twin of x.f64(). Bounded to f32 for the reason toF64 is: no other scalar has an exact widening the fp64 lowering implements.

예제

예제

import { f64 } from 'typeshade'
const radius = f64(6378137) // Node<'f64'>

대상별 지원

대상지원비고
WGSL (WebGPU) 에뮬레이션

Rewritten by fp64Lower into a pair of f32 lanes before the backend runs.

GLSL ES 3.00 (WebGL2) 에뮬레이션

Rewritten by fp64Lower into a pair of f32 lanes before the backend runs.

CPU 오라클 지원

Evaluated in f64 by the oracle.

관련 가이드

함께 보기

소스

src/core/ir/node.ts, 1046행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고