---
title: "ArithArg: type in Types, TypeShade API reference"
description: "ArithArg, a type in Types. The operand a binary arithmetic method accepts for a receiver of key K."
url: https://typeshade.dev/api/aritharg/
language: en
---

# `ArithArg`

Type in Types

The operand a binary arithmetic method accepts for a receiver of key K.

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

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

## Syntax

```ts
type ArithArg<K extends string> = K extends `vec${number}<${infer E}>`
  ? ReadonlyNode<K> | ReadonlyNode<KindScalar<E>> | number
  : ReadonlyNode<KindScalar<K>> | number;
```

## Description

For a vector receiver: the same vector key, or a scalar of the vector’s element kind (WGSL’s vector-scalar broadcast). For a scalar receiver: the same scalar kind. A `vec2` against a `vec3`, an integer against a float, or an `i32` against a `u32` is a type error. An `f64` receiver (and the scalar broadcast of an `f64` vector) also accepts `f32`, which widens exactly. A JS `number` is accepted everywhere and lifts to the receiver’s own scalar kind.

## Source

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