---
title: "toF64(): IR builder function in typeshade/core/ir, TypeShade"
description: "toF64, an IR builder function in typeshade/core/ir. Widen f32 to f64, exactly (the result is the pair (x, 0.0))."
url: https://typeshade.dev/api/tof64/
language: en
---

# `toF64()`

Function in Builtins

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

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

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

## Syntax

```ts
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

| Target | Support | Notes |
| --- | --- | --- |
| 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. |

## Source

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