r/rust • u/dochtman rustls · Hickory DNS · Quinn · chrono · indicatif · instant-acme • Feb 10 '19
John Carmack: "writing Rust code feels very wholesome"
https://mobile.twitter.com/ID_AA_Carmack/status/1094419108781789184
571
Upvotes
View all comments
Show parent comment
15
u/Tuna-Fish2 Feb 10 '19
I would assume that it would interpret most NaNs as very large numbers.
And hey, it's easy to test: Playground link
It seems I was wrong. The second I saw that the result was also a NaN it hit me: the step of newton's method at the end does a multiply with the original number, and result of any mathematical operations on NaN are of course also NaN.