Third try, this probably compiles better: bool isInitNan(T)(T f) if (isFloatingPoint!T) { union FPInt { T f; static if (is(T == float)) uint data; static if (is(T == double)) ulong data; static if (is(T == real)) ubyte[real.sizeof] data; } static FPInt fnan, fx; fx.f = f; return fnan.data == fx.data; } Bye, bearophile