Static constexpr bool is_iec559 #include īool isFloatIeee754 = std::numeric_limits::is_iec559() The standard library includes a template to detect if IEEE754 is supported or not: True if and only if the type adheres to IEC 559 standard.217 If the second operand of / or % is zero the behavior is undefined The C++ standard state that a division by 0.0 is undefined Undefined means, the compiler implementation decides, and there are many variables to that like the hardware architecture, code generation efficiency, compiler developer laziness, etc. If the hardware/compiler implement correctly the IEEE 754 standard, the division will provide the expected INF, -INF and NaN, otherwise. C++ standard does not force the IEEE 754 standard, because that depends mostly on hardware architecture.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |