# Odd example :-)

**URL:** <https://discourse.julialang.org/t/odd-example/97460>\
**Category:** General Usage\
**Created:** [April 14, 2023, 8:41am UTC](https://discourse.julialang.org/t/odd-example/97460 "2023-04-14T08:41:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [April 14, 2023, 8:41am UTC](https://discourse.julialang.org/t/odd-example/97460/1 "2023-04-14T08:41:55Z")

</div>

hmmm… I assume because `min` trasforming the int to a float round it up a little and doing that it brings it over the value of typemax… any nice workaround rather than manually remove values ?

```julia
julia> Int(typemax(Int64))
9223372036854775807

julia> Int(min(typemax(Int64),Inf))
ERROR: InexactError: Int64(9.223372036854776e18)
Stacktrace:
 [1] Int64(x::Float64)
   @ Base ./float.jl:788
 [2] top-level scope
   @ REPL[29]:1

```

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [April 14, 2023, 8:43am UTC](https://discourse.julialang.org/t/odd-example/97460/2 "2023-04-14T08:43:17Z")

</div>

Got it…

```julia
julia> Int(min(maxintfloat(Float64),Inf))
9007199254740992

```
