---
title: "CpuPrecision: type in CPU oracle, TypeShade API reference"
description: "CpuPrecision, a type in CPU oracle. How the CPU backends evaluate f32 arithmetic."
url: https://typeshade.dev/api/cpuprecision/
language: en
---

# `CpuPrecision`

Type in CPU oracle

How the CPU backends evaluate `f32` arithmetic.

`import type { CpuPrecision } from 'typeshade'`

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

## Syntax

```ts
type CpuPrecision = 'f64' | 'f32';
```

## Description

- `'f64'` (default): every value is a JavaScript double, so the result is the mathematically intended one to 53 bits. This is the reference an implementation is checked against.
- `'f32'`: a correctly rounding `f32` machine over the same IR the GPU receives. Every `f32`-typed operation rounds to `f32` after it is evaluated, with ±Infinity on overflow. Use it when the question is what the target computes, so a parity gate can compare at ulp scale without a tolerance wide enough to hide a real error.

## See also

- [`compileModule`](https://typeshade.dev/api/compilemodule/)

## Source

[`src/core/oracle.ts`, line 727](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/oracle.ts#L727), at commit af54ddad5
