toF64
On this page

toF64()

Function in Builtins

Widen f32 to f64, exactly (the result is the pair (x, 0.0)).

import { toF64 } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

const toF64: (x: ReadonlyNode<"f32"> | number) => Node<"f64">

Parameters

x ReadonlyNode<'f32'> | number

Return value

Node<'f64'>

Description

Widen f32 to f64, exactly (the result is the pair (x, 0.0)). This is the explicit form of the widening the arithmetic methods apply on their own when an f32 meets an f64.

Targets

TargetSupportNotes
WGSL (WebGPU) Emulated

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

GLSL ES 3.00 (WebGL2) Emulated

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

CPU oracle Supported

Evaluated in f64 by the oracle.

In the guide

Source

src/core/ir/node.ts, line 2380, at commit 26de7be8

Edit this page Report a problem