# Input Type

**URL:** <https://discourse.julialang.org/t/input-type/56716>\
**Category:** Performance\
**Tags:** question\
**Created:** [March 8, 2021, 8:22am UTC](https://discourse.julialang.org/t/input-type/56716 "2021-03-08T08:22:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vlederer](https://avatars.discourse-cdn.com/v4/letter/v/e8c25b/32.png) [@vlederer](https://discourse.julialang.org/u/vlederer)\
**Post date:** [March 8, 2021, 8:22am UTC](https://discourse.julialang.org/t/input-type/56716/1 "2021-03-08T08:22:56Z")

</div>

Hi, in a solver framework I am using a custom function which takes Array{\<:\*\*AbstractFloat,\*\*1} as input.  
In practice, This AbstractFloat can be either Float32 or Float64. In terms of performances, should I create two functions, dealing respectively with Float32 and Float64? Btw this also means to maintain two functions doing the same thing. Or the evaluation cost using AbstractFloat is fine?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [March 8, 2021, 8:34am UTC](https://discourse.julialang.org/t/input-type/56716/2 "2021-03-08T08:34:19Z")

</div>

A method is always compiled anew for each new set of _concrete_ types it receives. Your type signature does not reflect the types of the input arguments themselves, but it’s like a funnel which accepts certain concrete types for your method. As long as you only feed it Vector{Float64} or Vector{Float32} you will not have any costs related to AbstractFloat

Regarding Float32 and Float64, this should work fine as long as you don’t use Float64 literals in your code that convert Float32 input to Float64 when multiplied or otherwise combined.

---

<div class="post-metadata">

**Author:** ![vlederer](https://avatars.discourse-cdn.com/v4/letter/v/e8c25b/32.png) [@vlederer](https://discourse.julialang.org/u/vlederer)\
**Post date:** [March 15, 2021, 8:30am UTC](https://discourse.julialang.org/t/input-type/56716/3 "2021-03-15T08:30:49Z")

</div>

Ty for your help, I understand better now!
