---
title: "vec2f64(): IR builder function in typeshade/core/ir"
description: "vec2f64, an IR builder function in typeshade/core/ir. An emulated-double vec2<f64> constructor."
url: https://typeshade.dev/api/vec2f64/
language: en
---

# `vec2f64()`

Function in Builtins

An emulated-double `vec2<f64>` constructor.

`import { vec2f64 } from 'typeshade/core/ir'`

This export returns an IR node. A `"use typeshade"` file calls the builtin itself: [`vec2f64()`](https://typeshade.dev/reference/functions/vec2f64/)

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

## Syntax

```ts
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`](https://typeshade.dev/api/vec2/) wherever the value needs more than the seven or so significant digits of `f32`.

## Examples

### Example

```ts
import { vec2f64 } from 'typeshade/core/ir'

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

## In the guide

- [fp64](https://typeshade.dev/guide/internals/fp64/)

## See also

- [`vec2f64()`](https://typeshade.dev/reference/functions/vec2f64/)
- [`vec2`](https://typeshade.dev/api/vec2/)

## Source

[`src/core/ir/node.ts`, line 2348](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L2348), at commit af54ddad5
