# ALTRO: InexactError: trunc(UInt8, 279)

**URL:** https://discourse.julialang.org/t/altro-inexacterror-trunc-uint8-279/108954
**Category:** New to Julia
**Tags:** question, inexacterror
**Created:** [January 18, 2024, 12:10pm UTC](https://discourse.julialang.org/t/altro-inexacterror-trunc-uint8-279/108954 "2024-01-18T12:10:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![G11](https://avatars.discourse-cdn.com/v4/letter/g/ba9def/32.png) [@G11](https://discourse.julialang.org/u/G11)
#### Post date: [January 18, 2024, 12:10pm UTC](https://discourse.julialang.org/t/altro-inexacterror-trunc-uint8-279/108954/1 "2024-01-18T12:10:18Z")

</div>

Hi,

I am using the ALTRO package to do trajectory optimization. I get the following InexactError sometimes when I run the code. Sometimes it works fine and there is no error code. Has anybody faced this issue before? What could be causing this error and how could I mitigate this? Thank you.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/8/984164b6a89f1e9e26a551b0a3d8ba7ea6e6e7d9.png)

---

<div class="post-metadata">

### Author: ![mike.ingold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike.ingold/32/203749_2.png) [@mike.ingold](https://discourse.julialang.org/u/mike.ingold)
#### Post date: [January 18, 2024, 12:37pm UTC](https://discourse.julialang.org/t/altro-inexacterror-trunc-uint8-279/108954/2 "2024-01-18T12:37:13Z")

</div>

This looks like a bug. The `UInt8` type can only represent integers from 0 to 255, and the error is telling you that the code tried to perform an operation where no exact transformation could be performed, I.e. 279 can’t be represented by this type.
