1 static const double internalEndianMagic = 7.949928895127363e-275; 2 static const unsigned char ieee_754_mantissa_mask[] = { 0x00, 0x0F, 0xFF, 0xFF, 3 0xFF, 0xFF, 0xFF, 0xFF }; 4 static inline int trio_isnan(double number)5trio_isnan (double number) 6 { 7 int has_mantissa = 0; 8 unsigned int i; 9 unsigned char current; 10 for (i = 0; i < (unsigned int)sizeof(double); i++) 11 { 12 current = ((unsigned char *)&number)[(((unsigned char 13 *)&internalEndianMagic)[7-(i)])]; 14 has_mantissa |= (current & ieee_754_mantissa_mask[i]); 15 } 16 return has_mantissa; 17 } 18 void xmlXPathEqualNodeSetFloat(int nodeNr,double v)19xmlXPathEqualNodeSetFloat(int nodeNr, double v) 20 { 21 int i; 22 for (i=0; i<nodeNr; i++) 23 if (!trio_isnan(v)) 24 break; 25 } 26 27