Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to panic when a NaN is created?

Tags:

nan

rust

I'm trying to find where a NaN is created in a huge codebase. Is there some compiler flag or something I can use to panic on NaN so I can find what line it's on?

like image 556
GirkovArpa Avatar asked Oct 27 '25 14:10

GirkovArpa


1 Answers

There's no compiler flag. The best you can do is to wrap your floats in noisy_float newtype.

like image 84
Kornel Avatar answered Oct 29 '25 07:10

Kornel