Skip to content

Commit

Permalink
change title and add link to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
carolynzech committed Aug 26, 2024
1 parent 1770870 commit e663d0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
- [Inductive data type](./challenges/0005-linked-list.md)
- [Contracts for SmallSort](./challenges/0008-smallsort.md)
- [Memory safety of String](./challenges/0010-string.md)
- [Memory Safety of Floats/Integers](./challenges/0011-floats-ints.md)
- [Safety of Methods for Numeric Primitive Types](./challenges/0011-floats-ints.md)
9 changes: 7 additions & 2 deletions doc/src/challenges/0011-floats-ints.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Challenge 11: Safety of Numeric Primitive Types
# Challenge 11: Safety of Methods for Numeric Primitive Types


- **Status:** Open
Expand All @@ -12,6 +12,8 @@

Verify the safety of public unsafe methods for floats and integers in `core::num`.

To find the documentation for these methods, navigate first to the [`core::num` documentation](https://doc.rust-lang.org/core/num/index.html), then click on the appropriate primitive type in the left-side menu bar. For example, for `i8::unchecked_add`, click on `i8`.

## Success Criteria

### Part 1: Unsafe Integer Methods
Expand All @@ -27,6 +29,7 @@ Prove the absence of undefined behavior in the following methods for each of the
| `unchecked_shr` | `i8`, `i16`, `i32`, `i64`, `i128`, `u8`, `u16`, `u32`, `u64`, `u128` |
| `unchecked_neg` | `i8`, `i16`, `i32`, `i64`, `i128` |


### Part 2: Safe API Verification

Now, verify some of the safe APIs that leverage the unsafe integer methods from Part 1. Verify the safety of the following methods for each of the listed integer types:
Expand All @@ -38,9 +41,11 @@ Now, verify some of the safe APIs that leverage the unsafe integer methods from
| `widening_mul` | `u8`, `u16`, `u32`, `u64` |
| `carrying_mul` | `u8`, `u16`, `u32`, `u64` |


### Part 3: Float to Integer Conversion

Verify the absence of undefined behavior in `to_int_unchecked` for `f16`, `f32`, `f64`, and `f128`.
Verify the absence of undefined behavior in `to_int_unchecked` for `f16`, `f32`, `f64`, and `f128`.


## List of UBs

Expand Down

0 comments on commit e663d0c

Please sign in to comment.