Rule A0-4-2 (required, implementation, automated)
Type long double shall not be used.
Rationale
The width of long double type, and therefore width of the significand, is implementation-defined. The width of long double type can be either: 64 bits, as the C++14 Language Standard allows long double to provide at least as much precision as type double does, or 80 bits, as the IEEE 754 standard allows extended precision formats (see: Extended-Precision-Format), or
Example
//% $Id: A0-4-2.cpp 289436 2017-10-04 10:45:23Z michal.szczepankiewicz $
void Fn() noexcept
{
float f1{0.1F};
// Compliant
double f2{0.1};
// Compliant
long double f3{0.1L}; // Non-compliant
}
See also
none