[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › Number

```ts
const Number: createTypeOfType("Number");
```

Defined in: [packages/common/src/Type.ts:2960](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Type.ts#L2960)

A JavaScript number, including `NaN`, `Infinity`, and `-Infinity`.

Use this Type directly only when those special values are meaningful. Most
numeric domains should exclude `NaN` with the [nonNaN](https://evolu.dev/docs/api-reference/common/Type/variables/nonNaN) Type Factory or
the predefined [NonNaNNumber](https://evolu.dev/docs/api-reference/common/Type/variables/NonNaNNumber). That is still insufficient for JSON and
other finite representations because it permits infinities; use
[FiniteNumber](https://evolu.dev/docs/api-reference/common/Type/variables/FiniteNumber) at those boundaries.

Even `FiniteNumber` is usually only a foundation for domain constraints.
[Int](https://evolu.dev/docs/api-reference/common/Type/variables/Int-1) additionally requires a safely representable integer because
JavaScript numbers outside the safe integer range cannot preserve exact
integer identity. Add sign, range, and domain Brands as required.

### Example

An age is a non-negative safe integer below 200:

```ts
import {
  assertEqual,
  assertErr,
  assertOk,
  assertType,
  Age,
  Data,
  FiniteNumber,
  Int,
  NonNaNNumber,
  NonNegativeInt,
  Number,
  type Brand,
} from "@evolu/common";

// Note how every additional constraint accumulates its Brand.
assertType<number, typeof Number.Output>();
assertType<number & Brand<"NonNaN">, typeof NonNaNNumber.Output>();
assertType<
  number & Brand<"NonNaN"> & Brand<"Finite">,
  typeof FiniteNumber.Output
>();
assertType<
  number & Brand<"NonNaN"> & Brand<"Finite"> & Brand<"Int">,
  typeof Int.Output
>();
assertType<
  number &
    Brand<"NonNaN"> &
    Brand<"Finite"> &
    Brand<"Int"> &
    Brand<"NonNegative">,
  typeof NonNegativeInt.Output
>();

assertType<
  number &
    Brand<"NonNaN"> &
    Brand<"Finite"> &
    Brand<"Int"> &
    Brand<"NonNegative"> &
    Brand<"LessThan200"> &
    Brand<"Age">,
  typeof Age.Output
>();

assertOk(Age.fromUnknown(122), 122);
const invalid = Age.fromUnknown(200);
assertErr(invalid);
assertType(Data, invalid.error);
assertEqual(invalid.error, {
  type: "LessThan200",
  value: 200,
  max: 200,
});
```