---
title: "2.8 Recap and reference"
url: https://una-lang.org/en/learn/numbers/recap-and-reference/
release: v0.4.0
edition: "0.2"
---

# 2.8 Recap and reference

## 2.8.1 For agents

:::agents
`una --json check .` prints each diagnostic with its `code`, `message`, `primary` span and `repairs`; `una --json test .` prints each example's outcome. U0007 carries an exact edit, the literal rewritten, which `una fix .` applies. U5001 gives a counterexample and repairs that are descriptions only (a guard, a wider type, a wrapping or saturating method). U0101, U1001, U1002, U2001 and U2022 depend on intent, so they carry no repair. The compact rule: *`Int` is unbounded and exact, with Euclidean `/` and `mod`; money is `Int` cents; every division by a value that is not a nonzero literal, and every operation or narrowing on `U8`…`U64`, `I8`…`I64`, is a proof obligation; types never convert implicitly.*
:::

## 2.8.2 Recap

:::recap
- Every value has a type. `print` takes a `Text`; put a number into one with braces: `"{units} units"`.
- `let name = value` names a value; `let name: Type = value` also states its type. A body makes each name once.
- `Int` is a whole number of any size, so a sum or a product is exact.
- Keep money in `Int` cents, and divide last: `order * 15 / 100`.
- `*`, `/` and `mod` come before `+` and `-`, left to right; parentheses change the order.
- `/` and `mod` are Euclidean. A divisor that may be zero is refuted with a counterexample.
- A fixed-width type, such as `U8`, is for a number of a set size. Every operation on it is proved to fit; wrapping and saturating are methods.
- Integer types never mix: convert with `to_int()`, or narrow with `to_u8()` and its proof.
:::

## 2.8.3 Reference

:::reference
- Construct pages: [source files, comments and literals](https://una-lang.org/en/docs/language/lexical-structure/), [functions](https://una-lang.org/en/docs/language/functions/), [`example`](https://una-lang.org/en/docs/language/examples/example/)
- Commands: [`una check`](https://una-lang.org/en/docs/cli/check/), [`una run`](https://una-lang.org/en/docs/cli/run/), [`una test`](https://una-lang.org/en/docs/cli/test/), [`una fix`](https://una-lang.org/en/docs/cli/fix/), [`una explain`](https://una-lang.org/en/docs/cli/explain/)
- Standard library: [the prelude](https://una-lang.org/en/docs/std/) (`abs`, `min`, `max`)
- Diagnostics: [U0007](https://una-lang.org/en/docs/errors/U0007/), [U0101](https://una-lang.org/en/docs/errors/U0101/), [U1001](https://una-lang.org/en/docs/errors/U1001/), [U1002](https://una-lang.org/en/docs/errors/U1002/), [U2001](https://una-lang.org/en/docs/errors/U2001/), [U2022](https://una-lang.org/en/docs/errors/U2022/), [U5001](https://una-lang.org/en/docs/errors/U5001/)
- Specification: [lexical structure](https://una-lang.org/en/docs/spec/01-lexical-structure/), [grammar](https://una-lang.org/en/docs/spec/02-grammar/), [types](https://una-lang.org/en/docs/spec/03-types/), [dynamic semantics](https://una-lang.org/en/docs/spec/11-dynamic-semantics/), [verification](https://una-lang.org/en/docs/spec/12-verification/), [the standard library](https://una-lang.org/en/docs/spec/14-standard-library/), [fixed-width integers](https://una-lang.org/en/docs/spec/18-fixed-width-integers/)
:::
