Update Floating-Point 7 for compiler verification

This commit is contained in:
Jackson Utsch 2022-10-07 12:51:29 -07:00 committed by GitHub
parent 055122f4fb
commit 2057e0b0f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -93,14 +93,19 @@ fn main() {
```rust,editable
// Replace ? with your answer
// Fill the blank to make it work
fn main() {
let x = 1_000.000_1; // ?
let y: f32 = 0.12; // f32
let z = 0.01_f64; // f64
assert_eq!(type_of(&x), "__".to_string());
println!("Success!");
}
fn type_of<T>(_: &T) -> String {
format!("{}", std::any::type_name::<T>())
}
```
8. 🌟🌟 Make it work in two distinct ways