> For the complete documentation index, see [llms.txt](https://stillwater-supercomputing-inc.gitbook.io/universal-numbers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stillwater-supercomputing-inc.gitbook.io/universal-numbers/fundamentals/number-systems/rational.md).

# rational

Adaptive, arbitrary precision decimal real with arithmetic exceptions

*rational* is an adaptive, arbitrary precision decimal sign-magnitude rational type.

The type definition for arbitrary precision rationals in *Universal* is:

```
class rational;
```

The **rational** type will dynamically adapt to the precision requirements of computation.

The **rational** type can be compiled with or without exceptions using a compile guard: RATIONAL\_THROW\_ARITHMETIC\_EXCEPTION, to be set before including the type in your module, like so:

```
#define RATIONAL_THROW_ARITHMETIC_EXCEPTION 1
#include <universal/number/rational/rational.hpp>
```

By default, exceptions are not enabled. They are defined, but not thrown, so client code will work in either configuration.

The **rational** type is useful for arbitrary precision decimal real applications. It uses the decimal system to represent values, so it can accurately represent 0.1, or 10% of a monetary value.
