Skip to content

Commit

Permalink
Update doc/src/challenges/0014-convert-num.md
Browse files Browse the repository at this point in the history
Co-authored-by: Carolyn Zech <cmzech@amazon.com>
  • Loading branch information
cvick32 and carolynzech authored Dec 16, 2024
1 parent 0de2dd0 commit 5c8d331
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/src/challenges/0014-convert-num.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ The safety constraints referenced in the comments are that the input value must:
These constraints are given in the [documentation](https://doc.rust-lang.org/std/primitive.f32.html#method.to_int_unchecked).

The intrinsic corresponds to the [fptoui](https://llvm.org/docs/LangRef.html#fptoui-to-instruction)/[fptosi](https://llvm.org/docs/LangRef.html#fptosi-to-instruction) LLVM instructions, which may be useful for reference.
Prove safety for each of the following conversions:
impl_float_to_int!(f16 => u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize);
impl_float_to_int!(f32 => u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize);
impl_float_to_int!(f64 => u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize);
impl_float_to_int!(f128 => u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize);

### List of UBs

Expand Down

0 comments on commit 5c8d331

Please sign in to comment.