# Issue with DynamicPolynomials and BigFloat coefficients?

**URL:** https://discourse.julialang.org/t/issue-with-dynamicpolynomials-and-bigfloat-coefficients/120814
**Category:** General Usage
**Tags:** polynomials, bigfloat
**Created:** [October 2, 2024, 2:03pm UTC](https://discourse.julialang.org/t/issue-with-dynamicpolynomials-and-bigfloat-coefficients/120814 "2024-10-02T14:03:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chkat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chkat/32/51707_2.png) [@chkat](https://discourse.julialang.org/u/chkat)
#### Post date: [October 2, 2024, 2:03pm UTC](https://discourse.julialang.org/t/issue-with-dynamicpolynomials-and-bigfloat-coefficients/120814/1 "2024-10-02T14:03:34Z")

</div>

I am experiencing an issue with the latest version of DynamicPolynomials (0.6) when I evaluate a polynomial with BigFloat coefficients at another BigFloat. I isolated a simple example that shows that I get different results if I set the variable `c` to `Float64(0)` or `BigFloat(0)`.

```julia
julia> using DynamicPolynomials

julia> @polyvar a b c
(a, b, c)

julia> F = BigFloat(5)*a*b*c + BigFloat(1)*a*b^2
5.0abc + ab²

julia> DynamicPolynomials.subs(F, c=>BigFloat(0))
0.0

julia> DynamicPolynomials.subs(F, c=>0)
ab²

```

On the contrary, for the version 0.4.6 of the package I get in both cases `ab²` as a result.  
\*I tried as well with the same polynomial and coefficient types Float64, and I get the same results

Does anyone know what is the reason please ? Are BigFloats not compatible with DynamicPolynomials ?

---

<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: [October 2, 2024, 2:07pm UTC](https://discourse.julialang.org/t/issue-with-dynamicpolynomials-and-bigfloat-coefficients/120814/2 "2024-10-02T14:07:12Z")

</div>

Report a bug.

---

<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: [October 3, 2024, 10:05am UTC](https://discourse.julialang.org/t/issue-with-dynamicpolynomials-and-bigfloat-coefficients/120814/3 "2024-10-03T10:05:56Z")

</div>

@chkat reported a bug, whereupon a fix was promptly pushed.

> <https://github.com/JuliaAlgebra/MultivariatePolynomials.jl/issues/302>
>
> Hi, 
> I am experiencing an issue with the latest version when I evaluate a polyn…omial with BigFloat coefficients at another BigFloat. I isolated a simple example that shows that I get different results if I set the variable \`c\` to \`Float64(0)\` or \`BigFloat(0)\`. 
> 
> \`\`\`julia
> julia\> using DynamicPolynomials
> 
> julia\> @polyvar a b c
> (a, b, c)
> 
> julia\> F = BigFloat(5)\*a\*b\*c + BigFloat(1)\*a\*b^2
> 5.0abc + ab²
> 
> julia\> DynamicPolynomials.subs(F, c=\>BigFloat(0))
> 0.0
> 
> julia\> DynamicPolynomials.subs(F, c=\>0.0)
> ab²
> \`\`\`
> 
> On the contrary, for the version 0.4.6 of the package I get in both cases \`\`ab²\`\` as a result.
> Are operations with BigFloats not supported ?
> 
> Thanks !
