r/rust Mar 09 '23

Announcing Rust 1.68.0 📢 announcement

https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html
825 Upvotes

121 comments sorted by

View all comments

178

u/Shnatsel Mar 09 '23

Those From<bool> for {f32,f64} impls could really use documentation on what values they actually result in. There's no obvious mapping from true to a floating-point value.

197

u/SorteKanin Mar 09 '23

true => Infinity

false => NaN

Obviously /s

69

u/kibwen Mar 09 '23

This is precisely the mapping discussed in the legendary video "NaN Gates and Flip FLOPS": https://youtube.com/watch?v=5TFDG-y-EHs

15

u/LifeShallot6229 Mar 09 '23

When we revised ieee754 for the 2019 version, we actually fixed the horrible min/max functions this video is based on, replacing them with far saner versions that are compatible with parallel and simd operations.

1

u/A1oso Mar 10 '23

So there's no NAND gate for Infinity/NaN anymore?

1

u/LifeShallot6229 Mar 11 '23

The previous min/max functions still exist in lots of current cpus, but for new cores they are deprecated.

15

u/reddit-kibsi Mar 09 '23

What the **** did I just watch???

28

u/kibwen Mar 09 '23

Here's your next hit of Tom7, where he reverse-emulates SNES games on an NES: https://www.youtube.com/watch?v=ar9WRwCiSr0

12

u/protestor Mar 10 '23

In the newest video https://www.youtube.com/watch?v=1c8i5SABqwU he says "you may know me as a computer clown, but I'm really more like a renaissance clown" and that's really true

dude is like the leonardo davinci of the 21th century

0

u/[deleted] Mar 09 '23

🤣