vec2f64
On this page

vec2f64()

Function in Builtins

An emulated-double vec2<f64> constructor.

import { vec2f64 } from 'typeshade'

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

Syntax

const vec2f64: (...a: Vec64Arg[]) => Node<"vec2<f64>">

Parameters

...a Vec64Arg[]

Return value

Node<'vec2<f64>'>

Description

A bare number component splits without loss into its (hi, lo) f32 pair when the module is built (a JS number already is an f64), and an f32 node component widens exactly, so mixed arguments such as vec2f64(x64, 0) are fine. One argument splats to both components, WGSL-style. Use it over vec2 wherever the value needs more than the seven or so significant digits of f32.

Examples

Example

import { vec2f64 } from 'typeshade'
const p = vec2f64(1e8 + 0.5, 2) // Node<'vec2<f64>'>: exact, where an f32 vec2 would round

In the guide

See also

Source

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

Edit this page Report a problem