about summary refs log tree commit diff stats
path: root/001help.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-01-03 20:28:40 -0800
committerKartik Agaram <vc@akkartik.com>2020-01-03 22:12:28 -0800
commit2f899b3b2c0e6798237832e5f0a423e280f568fb (patch)
tree444fee5847f0925cf57637dd7a7b371ea2388711 /001help.cc
parent68071dca1e26e6100c288b69af4fea375754e2b1 (diff)
downloadmu-2f899b3b2c0e6798237832e5f0a423e280f568fb.tar.gz
5878
The current prototype doesn't really use floating point; drop the
guardrails there.
Diffstat (limited to '001help.cc')
-rw-r--r--001help.cc27
1 files changed, 0 insertions, 27 deletions
diff --git a/001help.cc b/001help.cc
index ff622162..de1b680f 100644
--- a/001help.cc
+++ b/001help.cc
@@ -207,33 +207,6 @@ void dump_and_exit(int sig, siginfo_t* /*unused*/, void* /*unused*/) {
 :(before "End Includes")
 #include <signal.h>
 
-//: For good measure we'll also enable SIGFPE.
-:(before "atexit(reset)")
-feenableexcept(FE_OVERFLOW | FE_UNDERFLOW);
-//? assert(sizeof(int) == 4 && sizeof(float) == 4);
-//? //                          | exp   |  mantissa
-//? int smallest_subnormal = 0b00000000000000000000000000000001;
-//? float smallest_subnormal_f = *reinterpret_cast<float*>(&smallest_subnormal);
-//? cerr << "ε: " << smallest_subnormal_f << '\n';
-//? cerr << "ε/2: " << smallest_subnormal_f/2 << " (underflow)\n";  // test SIGFPE
-:(before "End Includes")
-#include <fenv.h>
-:(code)
-#ifdef __APPLE__
-// Public domain polyfill for feenableexcept on OS X
-// http://www-personal.umich.edu/~williams/archive/computation/fe-handling-example.c
-int feenableexcept(unsigned int excepts) {
-  static fenv_t fenv;
-  unsigned int new_excepts = excepts & FE_ALL_EXCEPT;
-  unsigned int old_excepts;
-  if (fegetenv(&fenv)) return -1;
-  old_excepts = fenv.__control & FE_ALL_EXCEPT;
-  fenv.__control &= ~new_excepts;
-  fenv.__mxcsr &= ~(new_excepts << 7);
-  return fesetenv(&fenv) ? -1 : old_excepts;
-}
-#endif
-
 //: 6. Map's operator[] being non-const is fucking evil.
 :(before "Globals")  // can't generate prototypes for these
 // from http://stackoverflow.com/questions/152643/idiomatic-c-for-reading-from-a-const-map