# \`@floatToInt\` now has safety-checked undefined behavior · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/c7804277bf390eeba368e3565b2aff0cf96f86b0)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: c7804277bf390eeba368e3565b2aff0cf96f86b0

Requested commit: c7804277bf390eeba368e3565b2aff0cf96f86b0

Commit: c7804277bf390eeba368e3565b2aff0cf96f86b0

Tree: cdf926acbc28a278ffeeb92552631a724c2da98d

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
`@floatToInt` now has safety-checked undefined behavior

when the integer part does not fit in the destination integer type

 * Also fix incorrect safety triggered for integer casting an
   `i32` to a `u7`. closes #1138
 * adds compiler-rt function: `__floatuntidf`

```

## Parents

- [0b92d689d0e64164bb8908c807db9338d59c41ce](https://git.cafe/gitcafe/zig/commit/0b92d689d0e64164bb8908c807db9338d59c41ce?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/c7804277bf390eeba368e3565b2aff0cf96f86b0?format=markdown)
