# Change default precision

**URL:** <https://discourse.julialang.org/t/change-default-precision/6520>\
**Category:** Internals & Design\
**Created:** [October 18, 2017, 9:26am UTC](https://discourse.julialang.org/t/change-default-precision/6520 "2017-10-18T09:26:17Z")\
**Posts on this page:** 1\
**Showing post:** 47

<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:** [October 24, 2017, 9:02pm UTC](https://discourse.julialang.org/t/change-default-precision/6520/47 "2017-10-24T21:02:29Z")

</div>

I played around with it, and it is pretty feasible to write a fairly capable macro that not only changes floating-point literals, but also handles functions like `rand` and `ones`, while preserving cases like `rand(Float64)` that explicitly specify a precision.

I’ve posted a little (unregistered) package that implements this: [https://github.com/stevengj/ChangePrecision.jl](https://github.com/stevengj/ChangePrecision.jl)

I would appreciate it if people banged on it a bit to see how well it works and whether I missed any important functions. I can register it if it seems useful.

(I don’t recursively handle `include` yet, but this would be pretty easy to add if it is needed.)

---

_[View the full topic](https://discourse.julialang.org/t/change-default-precision/6520)._
