---
title: "Scalar: type in Types, TypeShade API reference"
description: "Scalar, a type in Types. The four native scalar kinds: the ones WGSL and GLSL ES 3.00 both represent directly in hardware, and the set a ShaderType of kind…"
url: https://typeshade.dev/api/scalar/
language: en
---

# `Scalar`

Type in Types

The four native scalar kinds: the ones WGSL and GLSL ES 3.00 both represent directly in hardware, and the set a ShaderType of kind: 'scalar' can carry.

`import type { Scalar } from 'typeshade'`
`import type { Scalar } from 'typeshade/core/ir'`

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

## Syntax

```ts
type Scalar = 'f32' | 'i32' | 'u32' | 'bool';
```

## Description

When a binary operator mixes two of them, the result follows the native promotion order `f32` > `i32` > `u32`. Emulated double precision is a separate `ShaderType` kind, [`f64T`](https://typeshade.dev/api/f64t/), so it never enters native promotion and every code path that switches on the scalar kind decides about it separately (see [`ShaderType`](https://typeshade.dev/api/shadertype/)).

## See also

- [`f64T`](https://typeshade.dev/api/f64t/)
- [`ShaderType`](https://typeshade.dev/api/shadertype/)

## Source

[`src/core/ir/types/shader-type.ts`, line 12](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/types/shader-type.ts#L12), at commit af54ddad5
