# Easily make all variables 32 bit?

**URL:** <https://discourse.julialang.org/t/easily-make-all-variables-32-bit/56615>\
**Category:** New to Julia\
**Created:** [March 6, 2021, 12:53pm UTC](https://discourse.julialang.org/t/easily-make-all-variables-32-bit/56615 "2021-03-06T12:53:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ribeiro](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@Ribeiro](https://discourse.julialang.org/u/Ribeiro)\
**Post date:** [March 6, 2021, 12:53pm UTC](https://discourse.julialang.org/t/easily-make-all-variables-32-bit/56615/1 "2021-03-06T12:53:23Z")

</div>

Hello,  
is there some way to force all implicitly declared variables from 64 to 32 bit? I know I can explicitly declare stuff as 32bit and write numbers as `1.0f0`. But I’d like to test the accuracy I lose in my 64 bit code (and performance I gain) when running in 32 bit mode (same hardware) without having to rewrite every single number and explicitly declare every single variable. Obviously, I’m expecting I’ll have to modify everything that is explicitly declared.  
Some global var or setting maybe?  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [March 6, 2021, 1:30pm UTC](https://discourse.julialang.org/t/easily-make-all-variables-32-bit/56615/2 "2021-03-06T13:30:30Z")

</div>

It sounds like [https://github.com/stevengj/ChangePrecision.jl](https://github.com/stevengj/ChangePrecision.jl) should fit your use case.

---

<div class="post-metadata">

**Author:** ![Ribeiro](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@Ribeiro](https://discourse.julialang.org/u/Ribeiro)\
**Post date:** [March 6, 2021, 1:49pm UTC](https://discourse.julialang.org/t/easily-make-all-variables-32-bit/56615/3 "2021-03-06T13:49:11Z")

</div>

Yep, sounds like it’s exactly what I need! Thanks!
