# MethodError: Cannot \`convert\` an object of type Missing to an object of type Float64

**URL:** <https://discourse.julialang.org/t/methoderror-cannot-convert-an-object-of-type-missing-to-an-object-of-type-float64/96160>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump\
**Created:** [March 16, 2023, 2:14am UTC](https://discourse.julialang.org/t/methoderror-cannot-convert-an-object-of-type-missing-to-an-object-of-type-float64/96160 "2023-03-16T02:14:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saba\_ghasemi](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Saba\_ghasemi](https://discourse.julialang.org/u/Saba_ghasemi)\
**Post date:** [March 16, 2023, 2:14am UTC](https://discourse.julialang.org/t/methoderror-cannot-convert-an-object-of-type-missing-to-an-object-of-type-float64/96160/1 "2023-03-16T02:14:57Z")

</div>

I tried to solve a very big optimization problem (MIQCP), and the error  
MethodError: Cannot `convert` an object of type Missing to an object of type Float64  
Closest candidates are:  
convert(::Type{T}, ::T) where T\<:Number at number.jl:6  
convert(::Type{T}, ::Number) where T\<:Number at number.jl:7  
convert(::Type{T}, ::Base.TwicePrecision) where T\<:Number at twiceprecision.jl:250  
appeared, how can I fix this?

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [March 16, 2023, 2:20am UTC](https://discourse.julialang.org/t/methoderror-cannot-convert-an-object-of-type-missing-to-an-object-of-type-float64/96160/2 "2023-03-16T02:20:57Z")

</div>

Do you know where the Missing value arises?  
Are you sure the problem is not that a missing value occurs in your computational flow? If not, Is there a specific Float64 value that you want to be the result of that conversion?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [March 16, 2023, 2:21am UTC](https://discourse.julialang.org/t/methoderror-cannot-convert-an-object-of-type-missing-to-an-object-of-type-float64/96160/3 "2023-03-16T02:21:27Z")

</div>

Can you provide a reproducible example?

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

<div class="post-metadata">

**Author:** ![Saba\_ghasemi](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Saba\_ghasemi](https://discourse.julialang.org/u/Saba_ghasemi)\
**Post date:** [March 16, 2023, 2:31pm UTC](https://discourse.julialang.org/t/methoderror-cannot-convert-an-object-of-type-missing-to-an-object-of-type-float64/96160/4 "2023-03-16T14:31:53Z")

</div>

When I solve the smaller same problem, it works. Thus, I think it is related to the size of the objective value

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [March 16, 2023, 7:42pm UTC](https://discourse.julialang.org/t/methoderror-cannot-convert-an-object-of-type-missing-to-an-object-of-type-float64/96160/5 "2023-03-16T19:42:15Z")

</div>

> [@Saba\_ghasemi](#):
>
> When I solve the smaller same problem, it works

Can you provide a reproducible example? It’s hard to offer advice without knowing the problem.
