Fixing C's Biggest Mistake

Dom Disc dominikus at scherkl.de
Sat Dec 31 14:28:56 UTC 2022


On Saturday, 31 December 2022 at 06:04:25 UTC, cc wrote:
> On Friday, 30 December 2022 at 02:03:39 UTC, Walter Bright 
> wrote:
>> NaNs are another excellent tool. They enable, for example, 
>> dealing with a data set that may have unknown values in it 
>> from bad sensors. Replacing that missing data with "0.0" is a 
>> very bad idea.
>
> How many D programmers acquire data from sensors that require 
> such default language-integrated fault detection?

E.g. we do.

> Versus how many D programmers would be well benefited from 
> having floating point types treated like other numeric types, 
> and sensibly default initialize to a usable 0 value?

Well, all other types should have a NaN value too. But D allows 
you to create such types, so its not such a big problem.

> Why is one group determined to be the one that needs its use 
> case catered to, and not the other?

I suspect that's C legacy. :-/




More information about the Digitalmars-d mailing list