# How to use size type as lower precision in Static Arrays?

**URL:** https://discourse.julialang.org/t/how-to-use-size-type-as-lower-precision-in-static-arrays/125457
**Category:** General Usage
**Tags:** parametric-types, staticarrays
**Created:** [February 1, 2025, 2:13pm UTC](https://discourse.julialang.org/t/how-to-use-size-type-as-lower-precision-in-static-arrays/125457 "2025-02-01T14:13:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mj2984](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mj2984/32/43833_2.png) [@mj2984](https://discourse.julialang.org/u/mj2984)
#### Post date: [February 1, 2025, 2:13pm UTC](https://discourse.julialang.org/t/how-to-use-size-type-as-lower-precision-in-static-arrays/125457/1 "2025-02-01T14:13:07Z")

</div>

Currently Static Arrays throws an error if the size type is anything other than Int64. Considering the size of Arrays is much smaller, is it possible to support other types such as UInt8, Int8, etc?

---

<div class="post-metadata">

### Author: ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)
#### Post date: [February 1, 2025, 2:24pm UTC](https://discourse.julialang.org/t/how-to-use-size-type-as-lower-precision-in-static-arrays/125457/2 "2025-02-01T14:24:52Z")

</div>

No, the type parameter must be an `Int` value. But that’s perfectly OK. Keep in mind the type parameter exists only at compilation time, there’s no run time cost to it.

Similar complaints are already present on the StaticArrays Github:

- [Only Int64 works for the length of the array · Issue #798 · JuliaArrays/StaticArrays.jl · GitHub](https://github.com/JuliaArrays/StaticArrays.jl/issues/798)
- [SVector{N,T} only accept Int64 but not Int32 · Issue #1233 · JuliaArrays/StaticArrays.jl · GitHub](https://github.com/JuliaArrays/StaticArrays.jl/issues/1233)
