> For the complete documentation index, see [llms.txt](https://docs.internetobject.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.internetobject.org/structure-and-syntax/values/number/special-formats.md).

# Special Numeric Formats

Besides ordinary decimal, a number may be written in **hexadecimal**, **octal**, **binary**, or **scientific** notation. These are just different ways of writing the same numeric value — the parser reads them all into one number.

| Notation    | Prefix / form | Example      | Value |
| ----------- | ------------- | ------------ | ----- |
| Decimal     | *(none)*      | `255`        | 255   |
| Hexadecimal | `0x`          | `0xFF`       | 255   |
| Octal       | `0o`          | `0o377`      | 255   |
| Binary      | `0b`          | `0b11111111` | 255   |
| Scientific  | `e` exponent  | `2.55e2`     | 255   |

```ruby
dec: number, hex: number, oct: number, bin: number, sci: number
---
255, 0xFF, 0o377, 0b11111111, 2.55e2
```

All five fields above hold the value `255`.

## Notes

* A leading sign is allowed: `-0x1A`, `+1.5e3`.
* Notation is independent of the field's type — any number type accepts any notation as input.
* How a number is **written back** on serialization is controlled by the schema's `format` option (`decimal`, `hex`, `octal`, `binary`, `scientific`); see [Numeric Types](/schema-definition-language/data-types/number.md).
* For very large integers use [BigInt](/structure-and-syntax/values/number/bigint.md) (`123n`); for exact decimals use [Decimal](/structure-and-syntax/values/number/decimal.md) (`1.50m`).

## See Also

* [Number](/structure-and-syntax/values/number/number.md) · [BigInt](/structure-and-syntax/values/number/bigint.md) · [Decimal](/structure-and-syntax/values/number/decimal.md)
* [NaN and Infinity](/structure-and-syntax/values/number/nan-and-infinity.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.internetobject.org/structure-and-syntax/values/number/special-formats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
