Hi Jim, > openbsd$ ./seq 4 > 1 > nan > nan > 4
Must be specific to OpenBSD/x86. I don't reproduce it on NetBSD 3.0/x86. > I tracked this to printf-posix's use of isnanl. Yes, that's quite obviously the isnanl-nolibm module (or the system's isnanl() function or isnan() macro). > That function from gnulib returns true for the long-double > values of 2 and 3 (exponent is 0 in those cases, yet this > code returns 1: > > if (exponent == 0) > return (m.word[1] >> 31); > > I don't have time to investigate further now. > Maybe tomorrow. The exponent is apparently incorrectly determined. What are the values of EXPBIT0_WORD, EXPBIT0_BIT, EXP_MASK? Is OpenBSD's 'long double' type the x86 80-bit one, or just the same as a 'double'? Bruno