# rationalize function

The simplest fraction equal to a decimal number.

## How to write it

### rationalize(x)

**x**

A decimal number. Takes a number.

## Examples

- $\displaystyle 0.5 = \frac{1}{2}$

  `rationalize(0.5)`

  In the solver, `rationalize(0.5)` gives `1/2`.

  [Open in the solver](https://hilberon.com/?q=rationalize%280.5%29)

## Related functions

- [chop](https://hilberon.com/library/chop)

  A number with tiny parts replaced by zero.
- [numeric](https://hilberon.com/library/numeric)

  Approximate a number with decimals.

---
Source: https://hilberon.com/library/rationalize
