chiark / gitweb /
add (disabled) code to test program to signal on NaN creation, for debugging
authorstevenj <stevenj@alum.mit.edu>
Fri, 13 Nov 2009 00:43:18 +0000 (19:43 -0500)
committerstevenj <stevenj@alum.mit.edu>
Fri, 13 Nov 2009 00:43:18 +0000 (19:43 -0500)
darcs-hash:20091113004318-c8de0-9d518702b3a469dfd45197b08f06f255c5175f06.gz

test/testopt.cpp

index 0345ea8b178ded3e6f7f81dff54e798c80c31fde..f00083add5d520c8a0d64aab94328d27dab136d6 100644 (file)
 #  include <getopt.h>
 #endif
 
+#define USE_FEENABLEEXCEPT 0
+#if USE_FEENABLEEXCEPT
+#  include <fenv.h>
+extern "C" int feenableexcept (int EXCEPTS);
+#endif
+
+
 #include "nlopt.h"
 #include "nlopt-util.h"
 #include "testfuncs.h"
@@ -237,6 +244,10 @@ int main(int argc, char **argv)
   
   if (argc <= 1)
     usage(stdout);
+
+#if USE_FEENABLEEXCEPT
+  feenableexcept(FE_INVALID);
+#endif
   
   while ((c = getopt(argc, argv, "hLvCc0:r:a:o:i:e:t:x:X:f:F:m:")) != -1)
     switch (c) {