I'm working on a safety critical, embedded program (in C) where I'd like to use IEEE 754 floating-point arithmetics (with NaN and Infs) for engineering calculations. Here I have two approach (afaik) to deal with floating point exceptions:
- go to a permanent fault state if any exception occurs. This one is might more robust from error detection point of view, but bad for fault-tolerance/availability.
ignore exceptions, and check the final results whether they finite numbers (sucsessfull calculation) or NaN, inf (failed calculation). This solution is more fault tolerant, but it is more risky because outputs might accidentally be excluded from the check.
- Which would be a better solution in a safety critical system?
- Are there other options?
- If the complexity of the calculations does not allow the first solution (I can not avoid exceptions in normal usage) are the final checks enough or are there other aspects I should consider?