Movement against float.init being nan

drug007 drug2004 at bk.ru
Sun Aug 21 12:52:58 UTC 2022


On 8/21/22 06:25, Walter Bright wrote:
> On 8/20/2022 6:19 AM, Hipreme wrote:
>> I don't see how easier it is to track a nan. Division by zero causes 
>> exception which is the best thing ever. Multiplication produces a zero 
>> result, which is pretty obvious to track. If the number does not 
>> change you will pretty much print both values and you'll easily find 
>> the 0 there.
> 
> x * NaN => NaN
> x / NaN => NaN
> x + NaN => NaN
> x - NaN => NaN
> -Nan => NaN
> cos(NaN) => NaN
> exp(NaN) => NaN
> 
> Only a subset of this is true for 0.
> 

I totally agree that NaN is really useful because makes it easier to 
find the reason for the NaN result


More information about the Digitalmars-d mailing list