diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-09-08 11:23:32 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-09-08 11:23:32 -0700 |
commit | 7426258146a0ddb624ab5def394ad38611c7caff (patch) | |
tree | 7cb8d440a5eeb9a9ce024fc3d597bb1f9f517d73 /001help.cc | |
parent | 32d4af5458a97152f19b97af664cf22599e1b3fd (diff) | |
download | mu-7426258146a0ddb624ab5def394ad38611c7caff.tar.gz |
3305 - show all available precision in numbers
Thanks Ella Couch for pointing out that Mu was lying when debugging small numbers. def main [ local-scope x:number <- copy 1 { x <- divide x, 2 $print x, 10/newline loop # until SIGFPE } ]
Diffstat (limited to '001help.cc')
-rw-r--r-- | 001help.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/001help.cc b/001help.cc index 351ae27a..8a092ffa 100644 --- a/001help.cc +++ b/001help.cc @@ -172,7 +172,8 @@ feenableexcept(FE_OVERFLOW | FE_UNDERFLOW); //? assert(sizeof(int) == 4 && sizeof(float) == 4); //? // | exp | mantissa //? int smallest_subnormal = 0b00000000000000000000000000000001; -//? float smallest_subnormal_f = *reinterpret_cast<int*>(&smallest_subnormal); +//? 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> |