# BigFloat type

**URL:** <https://discourse.julialang.org/t/bigfloat-type/114782>\
**Category:** General Usage\
**Tags:** bigfloat\
**Created:** [May 27, 2024, 1:42pm UTC](https://discourse.julialang.org/t/bigfloat-type/114782 "2024-05-27T13:42:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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 27, 2024, 3:22pm UTC](https://discourse.julialang.org/t/bigfloat-type/114782/2 "2024-05-27T15:22:11Z")

</div>

> [@Denis\_Dardenne](#):
>
> and I would like to transform the format Float64 to BigFloat. How do that ?

`big.(MyVar)`, maybe?

In general, if you want to use `BigFloat`, then you should change the _inputs_ to your function, e.g. pass a `BigFloat` for the input when you call ForwardDiff.jl (which is what I presume you are using). If you don’t use `BigFloat` all the way through, you will generally be limited by the accuracy of the least-precise step of the computation.

The ideal is to write your functions so that they always compute in the precision of their inputs, so that you can pass in whatever precision you want (`Float64`, `Float32`, `BigFloat`) later and they will do the right thing. This takes a little practice to do properly, with the help of Julia’s type-promotion and introspection machinery, but if you post a specific example of a short function people can give you some tips on how to make it precision-generic.

PS. Don’t post screenshots of code. Post quoted code, and post minimal _runnable_ snippets to make it easier for other people to help you. Read [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757)

---

_[View the full topic](https://discourse.julialang.org/t/bigfloat-type/114782)._
