# How to convert a multivariable polynomial with integer coefficients to one with Float64 coefficients?

**URL:** <https://discourse.julialang.org/t/how-to-convert-a-multivariable-polynomial-with-integer-coefficients-to-one-with-float64-coefficients/66438>\
**Category:** General Usage\
**Created:** [August 15, 2021, 1:48pm UTC](https://discourse.julialang.org/t/how-to-convert-a-multivariable-polynomial-with-integer-coefficients-to-one-with-float64-coefficients/66438 "2021-08-15T13:48:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![genkuroki](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/genkuroki/32/18030_2.png) [@genkuroki](https://discourse.julialang.org/u/genkuroki)\
**Post date:** [August 15, 2021, 2:34pm UTC](https://discourse.julialang.org/t/how-to-convert-a-multivariable-polynomial-with-integer-coefficients-to-one-with-float64-coefficients/66438/2 "2021-08-15T14:34:06Z")

</div>

Please quote the code by enclosing it in triple-backticks. See [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757)

Conversion can be done with `convert`:

```julia
using DynamicPolynomials
@polyvar x[1:3]
m = monomials(x, 0:3)
mD = differentiate.(m, x[1]) * 1.0
mD2 = convert.(Term{true, Float64}, differentiate.(m, x[1]))
mD2 == mD

```

```julia
true

```

This can be easily seen in the source code:

- [https://github.com/JuliaAlgebra/DynamicPolynomials.jl/blob/master/src/term.jl#L12-L14](https://github.com/JuliaAlgebra/DynamicPolynomials.jl/blob/master/src/term.jl#L12-L14)
- [https://github.com/JuliaAlgebra/DynamicPolynomials.jl/blob/master/src/poly.jl#L38-L41](https://github.com/JuliaAlgebra/DynamicPolynomials.jl/blob/master/src/poly.jl#L38-L41)

If you want to be comfortable, you should also take a look at the source code.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-convert-a-multivariable-polynomial-with-integer-coefficients-to-one-with-float64-coefficients/66438)._
