# \[ANN\] EmulatedBitIntegers.jl

**URL:** <https://discourse.julialang.org/t/ann-emulatedbitintegers-jl/137830>\
**Category:** Package Announcements\
**Created:** [June 28, 2026, 5:01am UTC](https://discourse.julialang.org/t/ann-emulatedbitintegers-jl/137830 "2026-06-28T05:01:02Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![matthias314](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Post date:** [June 28, 2026, 12:50pm UTC](https://discourse.julialang.org/t/ann-emulatedbitintegers-jl/137830/3 "2026-06-28T12:50:00Z")

</div>

The combination EmulatedBitIntegers.jl + PackedStructs.jl seems somewhat related to the type [`PackedVector`](https://matthias314.github.io/SmallCollections.jl/stable/packedvector/) from SmallCollections.jl. (Disclaimer: I’m the author.) For example

```julia-auto
julia> v = PackedVector{UInt16,5,Int8}([1,9])
2-element PackedVector{UInt16, 5, Int8}:
 1
 9

```

defines a vector with 5-bit integers that are packed into an `UInt16` (hence with maximal length 3) and appear to the outside as `Int8`. Besides vector operations like

```julia-auto
julia> Int8(3) * v
2-element PackedVector{UInt16, 5, Int8}:
  3
 -5

```

(note the overflow) there are functions like `push`, `filter` or `findfirst`.

Maybe one can combine `PackedVector` with EmulatedBitIntegers.jl to declare an honest element type `Int5` instead of the fake `Int8`.

---

_[View the full topic](https://discourse.julialang.org/t/ann-emulatedbitintegers-jl/137830)._
