On Wed, Apr 05, 2017 at 10:22:28PM +0200, Iain Buclaw wrote: > Which compiler?
$ LANG=C apt-cache policy ldc ldc: Installed: 1:1.1.1-1 > Are NaNs being honoured? Hmmm, no idea how to check this. > What if you were to replace > the `(x != x && f != f)` comparison with `(isNaN(x) && isNaN(f))` ? If I apply the following patch --- a/src/undead/stream.d +++ b/src/undead/stream.d @@ -1455,7 +1455,7 @@ class Stream : InputStream, OutputStream float f; assert(s.readf(&f)); - assert(x == f || (x != x && f != f)); //either equal or both NaN + assert(x == f || (isNaN(x) && isNaN(f))); //either equal or both NaN } tryFloatRoundtrip(1.0); I get ... [12/25] ldc2 '-Iundead_test@exe' '-I.' '-I..' '-I../src/' '-enable-color' '-O' '-release' '-g' '-unittest' -of 'undead_test@exe/src_undead_stream.d.o' -c ../src/undead/stream.d FAILED: undead_test@exe/src_undead_stream.d.o ldc2 '-Iundead_test@exe' '-I.' '-I..' '-I../src/' '-enable-color' '-O' '-release' '-g' '-unittest' -of 'undead_test@exe/src_undead_stream.d.o' -c ../src/undead/stream.d ../src/undead/stream.d(1458): Error: undefined identifier 'isNaN' ../src/undead/stream.d(1458): Error: undefined identifier 'isNaN' I have the feelingt that this meand "no" to your second question. Any other hints? Kind regards Andreas. -- http://fam-tille.de