# Problem in my code

**URL:** https://discourse.julialang.org/t/problem-in-my-code/105021
**Category:** New to Julia
**Created:** [October 16, 2023, 3:15pm UTC](https://discourse.julialang.org/t/problem-in-my-code/105021 "2023-10-16T15:15:16Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)
#### Post date: [October 16, 2023, 3:22pm UTC](https://discourse.julialang.org/t/problem-in-my-code/105021/2 "2023-10-16T15:22:39Z")

</div>

This is the same error you were having before. In line 14, you are trying to place a Float into an array of Integers. The quick fix is to remove all of the “`Int`” from your code. Test line-by-line to get a better understanding of what is going wrong rather than running the entire code at once.

> [@Error in my code](https://discourse.julialang.org/t/error-in-my-code/104930/4):
>
> Dividing two integers can result in a non-integer. julia\> 4/3 1.3333333333333333 You are then trying to put that non-integer into an array of integers, but Julia doesn’t know how you want to round it, so it throws an InexactError. julia\> Int[4/3] ERROR: InexactError: Int64(1.3333333333333333) You need to round the result yourself first. julia\> Int[round(Int,4/3)] # round to nearest 1-element Vector{Int64}: 1 julia\> Int[ceil(4/3)] # round up 1-element Vector{Int64}: 2 julia\> Int[fl…

(Your code formatting is better this time! 👍🏻 But you should also copy and paste your error message into a code block between ````` rather than posting a screenshot and try to use a more descriptive title.)

---

_[View the full topic](https://discourse.julialang.org/t/problem-in-my-code/105021)._
