Re:Beating Floating Point at Its Own Game: Posit Arithmetic ...
by dnautics on Saturday July 01, 2017 @01:40PM
(#14678036)
question: How do you access this status register using standard C? (because if you can't, basically no one will use it)
Re:Beating Floating Point at Its Own Game: Posit Arithmetic ...
by cesarb on Saturday July 01, 2017 @02:08PM
(#14678162)
You use feclearexcept() and fetestexcept() from fenv.h: https://linux.die.net/man/3/fenv
That doesn't help if the result could be partially valid, but if a "square root of minus one" or similar anywhere in the calculation means the result is invalid (and would be a NaN under floating point), sticky error bits in a status register could be sufficient.