|
In general, the main differences are Flexibility, customization of reporting, and multiplatform/compiler.
- Flexibility: Safefloat adds more granular control than FPE. FPE affects every variable in the system the same, while safefloat can be used to enforce some checks for a subgroup of all the floating point variables in the program or library, and even set different checks for different variables.
- Customization of reporting: Safefloat provides more options on how to react to failure. FPE will abort, while safefloat library provides different strategies to act when a check fails, it may be the case that you can expect a check to fail under certain conditions (exceptional behavior). An alternative would be to manually check flags after each operation, in place of doing that, safe float could throw an exception that can be handled properly.
- Multiplatform/compiler: Safefloat is C++17 standard compliand and it should work in any compiler implementing that standard.
|