# \#lossless

**URL:** https://discuss.ocaml.org/tag/lossless/713.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [Has anyone implemented an arithmetic encoder in OCaml?](https://discuss.ocaml.org/t/has-anyone-implemented-an-arithmetic-encoder-in-ocaml/16648)

<div class="topic-metadata">

**Author:** [@UnixJunkie](https://discuss.ocaml.org/u/UnixJunkie)\
**Replies:** 0\
**Last updated:** [May 15, 2025, 10:00am UTC](https://discuss.ocaml.org/t/has-anyone-implemented-an-arithmetic-encoder-in-ocaml/16648 "2025-05-15T10:00:21Z")

</div>

Hello, I tried once but I kind of gave up at the stage where I had to use some finite word size instead of arbitrary precision numbers. I think a possible generic interface might be: fun compress: string → int → st…
