double.init is real.nan, is it a bug?

Jonathan M Davis jmdavisProg at gmx.com
Thu Aug 15 00:07:39 PDT 2013


On Thursday, August 15, 2013 08:20:01 bsd wrote:
> For some reason I thought ('var' is double.nan) did this isNaN
> check, sort of like (key in AA) ... but 'in' is in and 'is' is,
> well, just is.

The is operate does a bitwise comparison, so it's checking whether the bits 
are identical or not. The primary place that it's used is comparing pointers. 
Beyond that, its use should probably be fairly rare as in most cases, what you 
want is ==.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list