dmd foreach loops throw exceptions on invalid UTF sequences, use replacementDchar instead

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Fri Nov 5 11:54:21 UTC 2021


On Friday, 5 November 2021 at 11:44:42 UTC, FeepingCreature wrote:
> When I have to do numeric work and suspect NaNs in play, I like 
> to `feenableexcept(FE_INVALID)`. Then every time a NaN arises 
> in a computation, I get a nice SIGFPE.

Yes, and the IEEE spec suggests that ones should be able to 
choose whether you get exceptions or compute with NaNs based on 
the nature of the application/computation. Regardless, as long as 
hardware follow IEEE and supports using NaN in calculations, you 
are better off playing up to the IEEE standard (for a modern 
system level language that means you should have easy access to 
both approaches).



More information about the Digitalmars-d mailing list