# How is Float16 implemented?

**URL:** <https://discourse.julialang.org/t/how-is-float16-implemented/98554>\
**Category:** Internals & Design\
**Created:** [May 9, 2023, 1:58pm UTC](https://discourse.julialang.org/t/how-is-float16-implemented/98554 "2023-05-09T13:58:03Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [May 9, 2023, 1:58pm UTC](https://discourse.julialang.org/t/how-is-float16-implemented/98554/1 "2023-05-09T13:58:03Z")

</div>

Found a `Float16` bug, the rounding of subnormals seems incorrect, however I can’t find the implementation of `Float16`. The help that’s built into the REPL and `@which` both just point me to “intrinsic functions”.

Is the `Float16` implementation in Julia at all, or is it all-LLVM?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [May 9, 2023, 2:08pm UTC](https://discourse.julialang.org/t/how-is-float16-implemented/98554/2 "2023-05-09T14:08:09Z")

</div>

> [@nsajko](#):
>
> Is the `Float16` implementation in Julia at all, or is it all-LLVM?

All the basic `Float16` arithmetic functions are implemented by LLVM, I believe.

---

<div class="post-metadata">

**Author:** ![gbaraldi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gbaraldi/32/22101_2.png) [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Post date:** [May 9, 2023, 2:08pm UTC](https://discourse.julialang.org/t/how-is-float16-implemented/98554/3 "2023-05-09T14:08:27Z")

</div>

It’s mostly LLVM, together with libgcc functions and whatnot.  
Could you open an issue on julia with an MWE so that we can track it?

---

<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:** [May 9, 2023, 2:45pm UTC](https://discourse.julialang.org/t/how-is-float16-implemented/98554/4 "2023-05-09T14:45:26Z")

</div>

[https://github.com/JuliaLang/julia/issues/49698](https://github.com/JuliaLang/julia/issues/49698)
