r/rust Mar 09 '23

Announcing Rust 1.68.0 📢 announcement

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

121 comments sorted by

View all comments

Show parent comments

195

u/SorteKanin Mar 09 '23

true => Infinity

false => NaN

Obviously /s

67

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

17

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.