---
title: "Fp64Flavor: type in Emulated f64, TypeShade API reference"
description: "Fp64Flavor, a type in Emulated f64. Which arithmetic primitives back the emulated-double (df64) helper functions that fp64Lower injects."
url: https://typeshade.dev/api/fp64flavor/
language: en
---

# `Fp64Flavor`

Type in Emulated `f64`

Which arithmetic primitives back the emulated-double (df64) helper functions that fp64Lower injects.

`import type { Fp64Flavor } from 'typeshade'`

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

## Syntax

```ts
type Fp64Flavor = 'float' | 'integer';
```

## Description

Which arithmetic primitives back the emulated-double (`df64`) helper functions that [`fp64Lower`](https://typeshade.dev/api/fp64lower/) injects. Both flavours compute the same values; they differ in what a target’s shader compiler is able to do to them.

- `'float'`: the default. Error-free transforms written in float arithmetic, protected from constant folding by a runtime guard binding, `_fp64`, that the host fills with `1.0`.
- `'integer'`: the `twoSum`, `twoProd`, division and square-root leaves are written in integer bit arithmetic; the compositions above them are shared with `'float'`. A fast-math pass cannot reassociate integer operations, so the hi/lo split survives on compilers that fold the float form (Apple Metal, and the ANGLE Direct3D 11 path through FXC). No guard binding is injected, because the integer bodies never read it.

Choose `'integer'` when a target’s compiler folds the float primitives. The symptom is emulated-double results degrading to `f32` precision on one platform while every other target is fine. [`recommendFp64Flavor`](https://typeshade.dev/api/recommendfp64flavor/) picks a flavour from a device’s adapter or renderer information.

## See also

- [`fp64Lower`](https://typeshade.dev/api/fp64lower/)
- [`recommendFp64Flavor`](https://typeshade.dev/api/recommendfp64flavor/)

## Source

[`src/core/passes/fp64-lower.ts`, line 37](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/fp64-lower.ts#L37), at commit af54ddad5
